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

pragya jain prag_2648 at yahoo.co.in
Sat Sep 28 05:19:56 UTC 2013


Thanks a lot for the response, Sir



>________________________________
> 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 2:45 PM
>Subject: Re: [Openstack] Fw: problem in understanding interaction between swift	proxy and other servers through swift source code
> 
>
>
>see underlined code below. it is invoked by sending http request and get result from response.
>
>
>pragya jain ---2013-09-27 下午 04:10:21---pragya jain <prag_2648 at yahoo.co.in>
>
>
> 
>
>To 
> 
>
>
>cc 
> 
>
>
>Subject 
>    
>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 
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20130928/750578b0/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/20130928/750578b0/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/20130928/750578b0/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic29732.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20130928/750578b0/attachment-0002.gif>


More information about the Openstack mailing list