<html><body><div style="color:#000; background-color:#fff; font-family:bookman old style, new york, times, serif;font-size:12pt"><div><span>Thanks a lot for the response, Sir</span></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"> <div style="font-family: 'bookman old style', 'new york', times, serif; font-size: 12pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1"> <font size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Hua ZZ Zhang <zhuadl@cn.ibm.com><br> <b><span style="font-weight: bold;">To:</span></b> pragya jain <prag_2648@yahoo.co.in> <br><b><span style="font-weight: bold;">Cc:</span></b> "openstack@lists.openstack.org" <openstack@lists.openstack.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, 27 September 2013 2:45 PM<br>
<b><span style="font-weight: bold;">Subject:</span></b> Re: [Openstack] Fw: problem in understanding interaction between swift proxy and other servers through swift source code<br> </font> </div> <div class="y_msg_container"><br><div id="yiv0692128375"><div>
<div><font size="2" face="sans-serif">see underlined code below. it is invoked by sending http request and get result from response.<br>
</font><br>
<br>
<img width="16" height="16" src="cid:1.590577206@web193603.mail.sg3.yahoo.com" border="0" alt="Inactive hide details for pragya jain ---2013-09-27 下午 04:10:21---pragya jain <prag_2648@yahoo.co.in>"><font size="2" color="#424282" face="sans-serif">pragya jain ---2013-09-27 下午 04:10:21---pragya jain <prag_2648@yahoo.co.in></font><br>
<br>
</div><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody><tr valign="top"><td style="background-image:url(cid:2__=C7BBF160DFA119A68f9e8a93df938@cn.ibm.com);background-repeat:no-repeat;" width="40%">
</td><td width="60%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody><tr valign="top"><td width="1%"><img width="58" height="1" src="cid:2.590577206@web193603.mail.sg3.yahoo.com" border="0" alt=""><br>
<div align="right"><font size="1" face="sans-serif">To</font></div></td><td width="100%"><img width="1" height="1" src="cid:2.590577206@web193603.mail.sg3.yahoo.com" border="0" alt=""><br>
</td></tr>
<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:2.590577206@web193603.mail.sg3.yahoo.com" border="0" alt=""><br>
<div align="right"><font size="1" face="sans-serif">cc</font></div></td><td width="100%"><img width="1" height="1" src="cid:2.590577206@web193603.mail.sg3.yahoo.com" border="0" alt=""><br>
</td></tr>
<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:2.590577206@web193603.mail.sg3.yahoo.com" border="0" alt=""><br>
<div align="right"><font size="1" face="sans-serif">Subject</font></div></td><td width="100%"><img width="1" height="1" src="cid:2.590577206@web193603.mail.sg3.yahoo.com" border="0" alt=""><br>
</td></tr>
</tbody></table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody><tr valign="top"><td width="58"><img width="1" height="1" src="cid:2.590577206@web193603.mail.sg3.yahoo.com" border="0" alt=""></td><td width="336"><img width="1" height="1" src="cid:2.590577206@web193603.mail.sg3.yahoo.com" border="0" alt=""></td></tr>
</tbody></table>
</td></tr>
</tbody></table>
<br>
<font size="1" color="#333333" face="Consolas"><b>But, Sir, At which line of code in the func </b></font><br>
<tt><font size="1" color="#0000FF"><i>def</i></font></tt><tt><font size="1"><i> _make_request(self, nodes, part, method, path, headers, query,</i></font></tt><br>
<tt><font size="2"><i> logger_thread_locals): </i></font></tt><br>
<tt><font size="2"><i>flow of control move to the AccoountController class defined in swift/account/server.py (for example)</i></font></tt><br>
<br>
<font size="1" color="#333333" face="Consolas"><b>def</b></font><font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#990000" face="Consolas"><b>_make_request</b></font><font size="1" color="#333333" face="Consolas">(</font><font size="1" color="#999999" face="Consolas">self</font><font size="1" color="#333333" face="Consolas">, nodes, part, method, path, headers, query,</font><br>
<font size="1" color="#333333" face="Consolas"> logger_thread_locals):</font><br>
<font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#DD1144" face="Consolas">"""</font><br>
<font size="1" color="#DD1144" face="Consolas"> Sends an HTTP request to a single node and<br>
aggregates the result.</font><br>
<font size="1" color="#DD1144" face="Consolas"> It attempts the primary node, then iterates over the handoff nodes</font><br>
<font size="1" color="#DD1144" face="Consolas"> as needed.</font><br>
<br>
<font size="1" color="#DD1144" face="Consolas"> :param nodes: an iterator of the backend server and handoff servers</font><br>
<font size="1" color="#DD1144" face="Consolas"> :param part: the partition number</font><br>
<font size="1" color="#DD1144" face="Consolas"> :param method: the method to send to the<br>
backend</font><br>
<font size="1" color="#DD1144" face="Consolas"> :param path: the path to send to the backend</font><br>
<font size="1" color="#DD1144" face="Consolas"> :param headers: a list of dicts, where each dict represents one</font><br>
<font size="1" color="#DD1144" face="Consolas"> backend request that should be made.</font><br>
<font size="1" color="#DD1144" face="Consolas"> :param query: query string to send to the backend.</font><br>
<font size="1" color="#DD1144" face="Consolas"> :param logger_thread_locals: The thread local values to be set on the</font><br>
<font size="1" color="#DD1144" face="Consolas"> self.app.logger to retain transaction</font><br>
<font size="1" color="#DD1144" face="Consolas"> logging information.</font><br>
<font size="1" color="#DD1144" face="Consolas"> :returns: a swob.Response object</font><br>
<font size="1" color="#DD1144" face="Consolas"> """</font><br>
<font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#999999" face="Consolas">self</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">app</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">logger</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">thread_locals </font><font size="1" color="#333333" face="Consolas"><b>=</b></font><font size="1" color="#333333" face="Consolas"> logger_thread_locals</font><br>
<font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#333333" face="Consolas"><b>for</b></font><font size="1" color="#333333" face="Consolas"> node </font><font size="1" color="#333333" face="Consolas"><b>in</b></font><font size="1" color="#333333" face="Consolas"> nodes:</font><br>
<font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#333333" face="Consolas"><b>try</b></font><font size="1" color="#333333" face="Consolas">:</font><br>
<font size="1" color="#333333" face="Consolas"> start_node_timing </font><font size="1" color="#333333" face="Consolas"><b>=</b></font><font size="1" color="#333333" face="Consolas"> time</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">time()</font><br>
<font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#333333" face="Consolas"><b>with</b></font><font size="1" color="#333333" face="Consolas"> ConnectionTimeout(</font><font size="1" color="#999999" face="Consolas">self</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">app</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">conn_timeout):</font><br>
<font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#333333" face="Consolas"><u> conn </u></font><font size="1" color="#333333" face="Consolas"><b><u>=</u></b></font><font size="1" color="#333333" face="Consolas"><u> http_connect(node[</u></font><font size="1" color="#DD1144" face="Consolas"><u>'ip'</u></font><font size="1" color="#333333" face="Consolas"><u>], node[</u></font><font size="1" color="#DD1144" face="Consolas"><u>'port'</u></font><font size="1" color="#333333" face="Consolas"><u>],</u></font><br>
<font size="1" color="#333333" face="Consolas"><u> node[</u></font><font size="1" color="#DD1144" face="Consolas"><u>'device'</u></font><font size="1" color="#333333" face="Consolas"><u>], part, method, path,</u></font><br>
<font size="1" color="#333333" face="Consolas"><u> headers</u></font><font size="1" color="#333333" face="Consolas"><b><u>=</u></b></font><font size="1" color="#333333" face="Consolas"><u>headers, query_string</u></font><font size="1" color="#333333" face="Consolas"><b><u>=</u></b></font><font size="1" color="#333333" face="Consolas"><u>query)</u></font><br>
<font size="1" color="#333333" face="Consolas"> conn</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">node </font><font size="1" color="#333333" face="Consolas"><b>=</b></font><font size="1" color="#333333" face="Consolas"> node</font><br>
<font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#999999" face="Consolas">self</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">app</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">set_node_timing(node, time</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">time() </font><font size="1" color="#333333" face="Consolas"><b>-</b></font><font size="1" color="#333333" face="Consolas"> start_node_timing)</font><br>
<font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#333333" face="Consolas"><b>with</b></font><font size="1" color="#333333" face="Consolas"> Timeout(</font><font size="1" color="#999999" face="Consolas">self</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">app</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">node_timeout):</font><br>
<font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#333333" face="Consolas"><u> resp </u></font><font size="1" color="#333333" face="Consolas"><b><u>=</u></b></font><font size="1" color="#333333" face="Consolas"><u> conn</u></font><font size="1" color="#333333" face="Consolas"><b><u>.</u></b></font><font size="1" color="#333333" face="Consolas"><u>getresponse()</u></font><br>
<font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#333333" face="Consolas"><b>if</b></font><font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#333333" face="Consolas"><b>not</b></font><font size="1" color="#333333" face="Consolas"> is_informational(resp</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">status) </font><font size="1" color="#333333" face="Consolas"><b>and</b></font><font size="1" color="#333333" face="Consolas"> \</font><br>
<font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#333333" face="Consolas"><b>not</b></font><font size="1" color="#333333" face="Consolas"> is_server_error(resp</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">status):</font><br>
<font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#333333" face="Consolas"><b>return</b></font><font size="1" color="#333333" face="Consolas"> resp</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">status, resp</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">reason, resp</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">getheaders(), \</font><br>
<font size="1" color="#333333" face="Consolas"> resp</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">read()</font><br>
<font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#333333" face="Consolas"><b>elif</b></font><font size="1" color="#333333" face="Consolas"> resp</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">status </font><font size="1" color="#333333" face="Consolas"><b>==</b></font><font size="1" color="#333333" face="Consolas"> HTTP_INSUFFICIENT_STORAGE:</font><br>
<font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#999999" face="Consolas">self</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">error_limit(node, _(</font><font size="1" color="#DD1144" face="Consolas">'ERROR Insufficient Storage'</font><font size="1" color="#333333" face="Consolas">))</font><br>
<font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#333333" face="Consolas"><b>except</b></font><font size="1" color="#333333" face="Consolas"> (</font><font size="1" color="#990000" face="Consolas"><b>Exception</b></font><font size="1" color="#333333" face="Consolas">, Timeout):</font><br>
<font size="1" color="#333333" face="Consolas"> </font><font size="1" color="#999999" face="Consolas">self</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">exception_occurred(node, </font><font size="1" color="#999999" face="Consolas">self</font><font size="1" color="#333333" face="Consolas"><b>.</b></font><font size="1" color="#333333" face="Consolas">server_type,</font><br>
<font size="1" color="#333333" face="Consolas"> _(</font><font size="1" color="#DD1144" face="Consolas">'Trying to %(method)s %(path)s'</font><font size="1" color="#333333" face="Consolas">) </font><font size="1" color="#333333" face="Consolas"><b>%</b></font><br>
<font size="1" color="#333333" face="Consolas"> {</font><font size="1" color="#DD1144" face="Consolas">'method'</font><font size="1" color="#333333" face="Consolas">: method, </font><font size="1" color="#DD1144" face="Consolas">'path'</font><font size="1" color="#333333" face="Consolas">: path})</font><br>
<br>
<tt><font size="2"><i>---</i></font></tt><br>
<br>
<tt><font size="2"><i>Thank you very much </i></font></tt><br>
<br>
<tt><font size="2"><i>Pragya Jain</i></font></tt>
</div></div><img src="cid:3.590577206@web193603.mail.sg3.yahoo.com"><br><br></div> </div> </div> </blockquote></div> </div></body></html>