[Twisted-Python] adbapi / Postgres : LISTEN/NOTIFY and RealDictCursor
glyph at twistedmatrix.com
Thu Nov 3 18:54:11 EDT 2011
On Nov 3, 2011, at 6:18 PM, Tobias Oberstein wrote:
> while not self.stopped:
> if select.select([conn], , , self.timeout) == (, , ):
Please note that on high-volume servers, this is problematic, as 'conn' may be higher than the maximum file descriptor pollable by select(). So if you've tuned everything to be smart, use a high-volume reactor like epoll, and set all your ulimits correctly, you will still get tracebacks out of this code depending on random accidents of ordering.
This part of the logic might therefore be better implemented as a IReadDescriptor/IWriteDescriptor provider (i.e. a subclass of FileDescriptor), assuming you can ask your postgres binding to give you non-blocking reads and writes. You're certainly not the first person to make this mistake though, <http://divillo.com/> gives the same advice :).
Also this would probably make a better patch for txpostgres <https://launchpad.net/txpostgres> than for Twisted itself, since support depends on specific database bindings.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python