Hi Paul,<br><br>I have got the debug environment setup for Swift only. I have a devstack installation running on my machine. I use python debugger (pdb) for debugging. To debug any method you can issue 'pdb.set_trace()' call in that method (after importing pdb) and restart that particular service from "screen". (You can get multiple screens in devstack by 'screen -r stack' in running devstack directory. And service can be restarted by first switching to screen of service using Ctrl+A+screen_num, than pressing Ctrl+C to stop service, and pressing Up arrow to get command to restart the service).  <br>
<br>To get into some server methods such as PUT, GET, WRITE etc. in account, container and object, after calling pdb.set_trace() in them, you need to issue Swift commands such as Post and Upload from shell. And the screen of that particular service at which pdb was called will take you into debugger. <br>
<br>Regards,<br>M Kazim<br><br><br><br><div class="gmail_quote">On Tue, Jul 23, 2013 at 4:25 PM, Luse, Paul E <span dir="ltr"><<a href="mailto:paul.e.luse@intel.com" target="_blank">paul.e.luse@intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">HI Muhammad
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">If you’ve got full debug working well, I would love to replicate your environment (and suspect I’m not the only one).  If you have some time, it would be great
 if you could detail setup instructions and config options on this post.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Thx<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Paul<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Openstack [mailto:<a href="mailto:openstack-bounces%2Bpaul.e.luse" target="_blank">openstack-bounces+paul.e.luse</a>=<a href="mailto:intel.com@lists.launchpad.net" target="_blank">intel.com@lists.launchpad.net</a>]
<b>On Behalf Of </b>Muhammad Kazim<br>
<b>Sent:</b> Tuesday, July 23, 2013 12:33 AM<br>
<b>To:</b> Gareth<br>
<b>Cc:</b> <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a></span></p><div class="im"><br>
<b>Subject:</b> Re: [Openstack] Issue in debugging OpenStack Swift<u></u><u></u></div><p></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Worked perfectly in the first attempt. Thanks a lot for the help. :)
<u></u><u></u></p><div><div class="h5">
<div>
<p class="MsoNormal">On Tue, Jul 23, 2013 at 10:41 AM, Gareth <<a href="mailto:academicgareth@gmail.com" target="_blank">academicgareth@gmail.com</a>> wrote:<u></u><u></u></p>
<div>
<p class="MsoNormal">the key reason it here: <a href="https://github.com/openstack/swift/blob/master/swift/common/utils.py#L1047" target="_blank">https://github.com/openstack/swift/blob/master/swift/common/utils.py#L1047</a><u></u><u></u></p>

<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">you have many ways to stop flush IO; I prefer add a line "stdio_files = []" after line 1037<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<div>
<div>
<p class="MsoNormal">On Sun, Jul 21, 2013 at 1:58 AM, Muhammad Kazim <<a href="mailto:kazimalik@gmail.com" target="_blank">kazimalik@gmail.com</a>> wrote:<u></u><u></u></p>
</div>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi all,<br>
<br>
I wanted to debug Swift source code. I have a Devstack setup running on my machine that i have configured to only run keystone, mysql and swift.<br>
<br>
I have used pdb to debug source code. I was able to debug python-swiftclient, middleware (common), and proxy-server code. However, when i try to debug Object Server of Swift, by issuing pdb.set_trace() call in diskwrite or any write function in /swift/obj/server.py
 (except constructor) and than issue a 'swift post' or 'swift upload' command from other terminal, the object server crashes. The screen of s-object shows an error in the line in which 'pdb.set_trace()' is called.<br>

<br>
Can someone please guide me how can i debug the Swift s-object code in /swift/obj/server.py. Thanks.<br>
<br>
Regards,<br>
Muhammad Kazim<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">_______________________________________________<br>
Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
Post to     : <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><u></u><u></u></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><span style="color:#888888"><br>
<br clear="all">
<span><u></u><u></u></span></span></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal"><span><span style="color:#888888">-- </span><u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="color:#444444">Gareth</span><u></u><u></u></p>
<div>
<p class="MsoNormal"><span style="color:#888888"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal"><i><span style="color:#444444">Cloud Computing, OpenStack, Fitness, Basketball</span></i><span style="color:#888888"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><i><span style="color:#666666">OpenStack contributor</span></i><span style="color:#888888"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><i><span style="color:#666666">Company: <a href="http://www.ustack.com" target="_blank">
UnitedStack</a></span></i><span style="color:#888888"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><i><span style="color:#999999">My promise: if you find any spelling or grammar mistakes in my email from Mar 1 2013, notify me </span></i><span style="color:#888888"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><i><span style="color:#999999">and I'll donate $1 or </span>
</i><i><span style="font-family:"MS Gothic";color:#999999">¥</span><span style="color:#999999">1 to an open organization you specify.</span></i><span style="color:#888888"><u></u><u></u></span></p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div></div></div>
</div>

</blockquote></div><br>