[Twisted-Python] Adbapi issues

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Thu Aug 6 13:24:44 MDT 2009


On 06:57 pm, grickert at coldstorage.com wrote:
>[snip]
>>
>>Supporting arraysize in some form is probably a good idea. Another
>>ticket is in order.
>
>Ok, I filed ticket #3956
>...along with a patch for adbapi.py, and test_adbapi.py.

Great.  Thanks a lot! :)
>My apologies in advance for the test patch :o)
>I haven't written many tests, so I'm not exactly sure the best
>(or perhaps even a good way) of testing some things.

No worries.  I've given you some feedback on the ticket (I did that
before I noticed this email).  Please feel free to ask if anything
I wrote is unclear.
>[snip]
>
>...my understanding is that it's relatively easy to kill a thread on a
>Unix platform, but not as easy with Windows (which, unfortunately I
>use almost exclusively).

It's about equally easy on either platform.  However, it's also
basically unreliable on both platforms.  What happens if the killed
thread held a mutex, for example?
>...maybe once *most* users are up to at least python version 2.6 (I'm
>not),
>I wonder if the threadpool in adbapi could be replaced with
>functionality
>> From the multiprocessing package.  I would think it would be easier to
>just kill and restart dead connections then.

Twisted actually has good support for running child processes already,
so we don't have to wait for Python 2.6, if this is a direction that's
interesting.

Perhaps something based on Ampoule would make sense?  It could be an API
compatible replacement for twisted.enterprise.adbapi, but use child 
processes
instead of threads, and add one new method for interrupting outstanding
work.

Jean-Paul




More information about the Twisted-Python mailing list