Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Select unreliably unblocks when closing sockets on linux #168
This isn’t a very big deal, but something to perhaps clean up in the future. The new headless command server is letting me see much more information on our shutdown and one thing I notice is that we have an interface that is using tcpip_client_interface with nil timeouts for both read and write (it is expected that this interface won’t be constantly transmitting). Anyway, it is failing to shut down cleanly on exit (full message below).
It looks like tcpip_socket_stream expects to get a IOERROR or Errno::ENOTSOCK when the socket is closed while waiting on the select(), but that apparently isn’t happening.
It looks like this may be a common problem that can be refactored around by just doing a blocking read instead of using select:
I could refactor the target on the other side to send packets more frequently so we could use a timeout, but that seems a workaround rather than a fix.
2015/07/09 15:02:07.156 INFO: Killing thread for interface BUSMON_INT
2015/07/09 15:02:08.171 INFO: Disconnected from interface BUSMON_INT