<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>Le Oct 4, 2012 à 12:26 PM, E S &lt;<a href="mailto:electric.or.sharp@gmail.com">electric.or.sharp@gmail.com</a>&gt; a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite">On Wed, Oct 3, 2012 at 3:39 PM, Glyph &lt;<a href="mailto:glyph@twistedmatrix.com">glyph@twistedmatrix.com</a>&gt; wrote:<br><blockquote type="cite"><br>Le Oct 3, 2012 à 6:36 AM, Augusto Mecking Caringi &lt;<a href="mailto:augustocaringi@gmail.com">augustocaringi@gmail.com</a>&gt; a écrit :<br><br><blockquote type="cite">On Wed, Oct 3, 2012 at 8:27 AM, Itamar Turner-Trauring<br>&lt;<a href="mailto:itamar@itamarst.org">itamar@itamarst.org</a>&gt; wrote:<br><blockquote type="cite">On 10/03/2012 04:28 AM, Phil Mayers wrote:<br><blockquote type="cite">I think the behaviour it should be aiming for is clear:<br>1. Test each connection with "good_sql" before beginning the user<br>interaction/query<br></blockquote><br>The problem is that this adds latency; this can add up to quite a<br>slowdown if your database server is on a remote server and you're doing<br>lots of single queries (as opposed to runInteraction).<br></blockquote><br>Hi!<br><br>Sometime ago I faced some related problems and I found this code,<br>"ReconnectingConnectionPool":<br><br><a href="http://www.gelens.org/2009/09/13/twisted-connectionpool-revisited/">http://www.gelens.org/2009/09/13/twisted-connectionpool-revisited/</a><br><br>What are your opinion about it?<br></blockquote><br>If there are bugs in Twisted, or important missing features, step 1 should be to file a bug – first, of course, searching for duplicates – at &lt;<a href="http://twistedmatrix.com/trac/newticket">http://twistedmatrix.com/trac/newticket</a>&gt;. &nbsp;Especially if the workaround involves calling or overriding some private, internal implementation detail. &nbsp;If you're going to blog about a hack that fixes the problem for you, that post should link to the ticket, so that Twisted can move forward and provide a good experience for people getting started with it.<br><br>I hate the idea that step 1 for some poor new Twisted user would be to go searching around a couple dozen external websites to apply undocumented hacks to try to just get something basic, like relational database communication, to work acceptably for their application.<br><br>So, my opinion is that either this isn't a real problem, in which case you shouldn't use it, or it is a real problem, in which case Jeffrey Gelens and powdahound should open a ticket and explain why it's necessary :).<br><br>-glyph<br><br><br>_______________________________________________<br>Twisted-Python mailing list<br><a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python<br></blockquote><br>Well, I did reference two bugs already in the twisted bug tracker that<br>I believe are related to this issue (4964 definitely is anyway).</blockquote><div><br></div><div>Aah, I'm terribly sorry. &nbsp;#4964 is indeed this exact issue; I missed the link.</div><br><blockquote type="cite">These&nbsp;issues have been in the bug tracking system for years now so I'm not&nbsp;holding my breath on fixes any time soon.</blockquote><div><br></div><div>Well, someone who cares will then need to fix the issue for real :).</div><br><blockquote type="cite">I appreciate your desire to&nbsp;make twisted as good as it can be, but we all have schedules to meet&nbsp;and hacks, documented or not, are sometimes necessary to move the&nbsp;project along. So I definitely will consider input from people who&nbsp;have run into this situation and found a solution that has worked for&nbsp;them.<br></blockquote><div><br></div><div>Of course. &nbsp;But you should be aware that this is how issues remain open in the bug tracker for years - they only get fixed when people fix them :).</div><br><blockquote type="cite">If you're not convinced it's a real problem, it's pretty easy to&nbsp;recreate. Assuming your MySQL wait_timeout = 2, you can run the&nbsp;following code and get the (2006, 'MySQL server has gone away') error:<br></blockquote><div><br></div><div>No, I'm perfectly convinced it's a real problem. &nbsp;The description on #4964 was very helpful.</div><br><blockquote type="cite">4. Man up and fix adbapi myself<br></blockquote><div><br></div>While I might disagree with the wording, this is what I'd suggest :).</div><div><br><blockquote type="cite">I'm leaning towards #1 since it seems to be least invasive, but I am&nbsp;open to other opinions.<br></blockquote><br></div><div>I think you may be overestimating the difficulty involved in just fixing the bug for real. &nbsp;The conflict between schedule and fixing bugs in the right place - i.e. in Twisted - is that there is some <i>waiting</i>&nbsp;involved, not that fixing the bug is super hard. &nbsp;You have to wait for a code review, then wait for a release. &nbsp;But, assuming your fix is not terribly invasive, you can just do this:</div><div><br></div><div><ol class="MailOutline"><li>Fix the bug.</li><li>Submit your fix for review.</li><li>While you're waiting, of course, you need to ship some software, so ship a modified copy of the modified module with your package and hot-patch it at runtime, assuming the fix is not already applied. &nbsp;You can see examples of other projects (that I've worked on) doing that here:&lt;<a href="http://bazaar.launchpad.net/~divmod-dev/divmod.org/trunk/view/head:/Epsilon/epsilon/hotfix.py">http://bazaar.launchpad.net/~divmod-dev/divmod.org/trunk/view/head:/Epsilon/epsilon/hotfix.py</a>&gt; and here:&lt;<a href="http://trac.calendarserver.org/browser/CalendarServer/trunk/twext/patches.py">http://trac.calendarserver.org/browser/CalendarServer/trunk/twext/patches.py</a>&gt;.</li><li>Respond promptly to any review feedback, when it becomes available, and update your local copy.</li></ol></div><div><br></div><div>When a new version of Twisted ships with the bug fixed, and you can update to depend on it, just delete your local copy. &nbsp;Assuming that the final fix is reasonably close to the one that you implemented previously, even older versions of your software should keep working.</div><div><br></div><div>I hope you do elect to help out with this, we can always use more contributors :).</div><div><br></div><div>-glyph</div></body></html>