ask / carrot

AMQP Messaging Framework for Python (discontinued; Use Kombu instead)
http://ask.github.com/carrot/
BSD 3-Clause "New" or "Revised" License
197 stars 34 forks source link

Global request timeout #36

Open enginoid opened 13 years ago

enginoid commented 13 years ago

Without having intricate (or cursory) knowledge of sockets, it seems to me that only a very basic failure scenario is handled by the connect_timeout (perhaps aptly named to indicate that it does just that) currently implemented in BrokerConnection. I'm guessing that this means that only if the port is pretending not to be there (it's stealthed, and connection refusal isn't signaled), this timeout applies.

When experimenting with the current timeout mechanism, this timeout did not seem to kick in where I created a "dummy" server that either only listened to a given port or listened and subsequently accepted the connection, disregarding any messages received.

I'd be interested in allowing "more global" timeouts because our server has had some problems with responding under certain loads, and this currently makes our application hang until Apache times out.

I'm interested to hear if you've given any thought to this, and if you think this is a valid feature I'm available to help out implementing and/or testing this.

enginoid commented 13 years ago

Is it possible that there's at timeout when reading but no timeout when writing, at least to an AMPQ queue? It seems to me that a call to Publisher.send(...) for that backend is ending in a call to sock.sendall that's not wrapped in a pair of sock.settimeout(...) calls.