Closed GoogleCodeExporter closed 9 years ago
Thanks, fixed in revision f777838afd2d with some extra code to help with SSL
Original comment by barry.pe...@gmail.com
on 23 Jun 2011 at 12:58
This fix causes my program, which has multiple threads with connections to the
same RabbitMQ service, to throw "[Errno 57] Socket is not connected"
exceptions when trying to close any Connection after the first one is closed.
I'm not an expert on this sort of thing, but a comment in this Stack Overflow
thread
http://stackoverflow.com/questions/409783/socket-shutdown-vs-socket-close
suggests that "calling shutdown for reading and writing closes the underlying
connection and sends a FIN / EOF to the peer regardless of how many processes
have handles to the socket.".
It would seem that the sock.shutdown() call is not appropriate in an
environment where multiple threads might be sharing the socket, since when any
of them closes its connection, the socket will be disconnected for all of the
other threads too.
Original comment by jgarb...@gmail.com
on 23 Sep 2011 at 11:57
I neglected to mention that I'm using SSL connections to the RabbitMQ service,
if that matters in this case.
Original comment by jgarb...@gmail.com
on 23 Sep 2011 at 11:58
I guess with multithreaded code, the last thread only should call shutdown. But
without a call to shutdown, messages and acks send just before the program
(whether multi-threaded or not) terminates may be lost, so *some* call to
shutdown is needed.
Original comment by chr...@pianocktail.org
on 28 Sep 2011 at 3:46
This library doesn't support multiple threads sharing the same Connection,
you're really playing with fire there. Even if we undid this patch, it could
blow up in your face lots of other ways. It's OK though if separate threads
open separate Connections.
Original comment by barry.pe...@gmail.com
on 28 Sep 2011 at 10:20
Original issue reported on code.google.com by
chr...@pianocktail.org
on 26 May 2011 at 4:47Attachments: