This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Barney Stratford
Recipients Barney Stratford, jstasiak
Date 2021-01-07.16:53:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1610038425.1.0.0948556025131.issue42513@roundup.psfhosted.org>
In-reply-to
Content
Sure. So, I'm using STOMP to connect to a messaging server. STOMP uses heartbeats to detect and close failed connections. The problem was that if the connection fails before the protocol has set up its heartbeats then there's nothing to stop the whole thing hanging. I had a timeout on the socket.create_connection, thinking this would protect against this edge-case, but it wasn't sufficient.

STOMP is such a simple protocol that it's often worth writing your own code to handle it. Indeed, this is actively encouraged. My own STOMP code is about 250 lines in a single source file, compared to nearly 3500 lines in 13 files for stomp.py. I very much prefer to simplify things as much as possible, and smaller is almost always better in my view. Simplify!

So, I kept seeing this very occasional hang-up in my code, and probing it with gdb showed that the execution was always stuck inside the poll. Of course it was, as that's where it sits to wait for something to happen. Then I was lead astray by finding that website, so I saddled up to save the world, as one does in such situations.
History
Date User Action Args
2021-01-07 16:53:45Barney Stratfordsetrecipients: + Barney Stratford, jstasiak
2021-01-07 16:53:45Barney Stratfordsetmessageid: <1610038425.1.0.0948556025131.issue42513@roundup.psfhosted.org>
2021-01-07 16:53:45Barney Stratfordlinkissue42513 messages
2021-01-07 16:53:44Barney Stratfordcreate