[Openstack] Fw: problem in understanding interaction between swift proxy and other servers through swift source code

pragya jain prag_2648 at yahoo.co.in
Fri Sep 27 08:11:29 UTC 2013


But, Sir, At which line of code in the func 
def _make_request(self, nodes, part, method, path, headers, query,                      logger_thread_locals): 
flow of control move to the AccoountController class defined in swift/account/server.py (for example)

def _make_request(self, nodes, part, method, path, headers, query,
                      logger_thread_locals):
        """
Sends an HTTP request to a single node and aggregates the result.
It attempts the primary node, then iterates over the handoff nodes
as needed.

:param nodes: an iterator of the backend server and handoff servers
:param part: the partition number
:param method: the method to send to the backend
:param path: the path to send to the backend
:param headers: a list of dicts, where each dict represents one
backend request that should be made.
:param query: query string to send to the backend.
:param logger_thread_locals: The thread local values to be set on the
self.app.logger to retain transaction
logging information.
:returns: a swob.Response object
"""
        self.app.logger.thread_locals = logger_thread_locals
        for node in nodes:
            try:
                start_node_timing = time.time()
                with ConnectionTimeout(self.app.conn_timeout):
                    conn = http_connect(node['ip'], node['port'],
                                        node['device'], part, method, path,
                                        headers=headers, query_string=query)
                    conn.node = node
                self.app.set_node_timing(node, time.time() - start_node_timing)
                with Timeout(self.app.node_timeout):
                    resp = conn.getresponse()
                    if not is_informational(resp.status) and \
                            not is_server_error(resp.status):
                        return resp.status, resp.reason, resp.getheaders(), \
                            resp.read()
                    elif resp.status == HTTP_INSUFFICIENT_STORAGE:
                        self.error_limit(node, _('ERROR Insufficient Storage'))
            except (Exception, Timeout):
                self.exception_occurred(node, self.server_type,
                                        _('Trying to %(method)s%(path)s') %
                                        {'method': method, 'path': path})

---

Thank you very much 

Pragya Jain

>________________________________
> From: Hua ZZ Zhang <zhuadl at cn.ibm.com>
>To: pragya jain <prag_2648 at yahoo.co.in> 
>Cc: "openstack at lists.openstack.org" <openstack at lists.openstack.org> 
>Sent: Friday, 27 September 2013 1:12 PM
>Subject: Re: [Openstack] Fw: problem in understanding interaction between swift	proxy and other servers through swift source code
> 
>
>
>in swift/proxy/controllers/base.py
>
>def make_requests(self, req, ring, part, method, path, headers,
>                      query_string=''):
>
>def _make_request(self, nodes, part, method, path, headers, query,
>                      logger_thread_locals):
>
>
>pragya jain ---2013-09-27 下午 02:55:44---pragya jain <prag_2648 at yahoo.co.in>
>
>
> 
>
>To 
> 
>
>
>cc 
> 
>
>
>Subject 
>    
>Thanks Zhang for the reply.
>but my question is:
>According to swift source code,
>through which function call, the proxy server interact with account server, i.e., flow of control go from proxy server code to account server code?
>
>Thanks again
>
>Pragya Jain
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20130927/fbc37b17/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20130927/fbc37b17/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20130927/fbc37b17/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic11525.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20130927/fbc37b17/attachment-0002.gif>


More information about the Openstack mailing list