Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

SystemTimer is not always killing a process within the time specified. #1

kevintyll opened this Issue May 1, 2009 · 0 comments


None yet
1 participant

We are experiencing a timeout issue very similar to the one SystemTimer was designed for. Unfortunately, we are experiencing the same problem even after implementing the SystemTimer gem.

We are wrapping a timer around code that calls the HTTParty gem that ultimately calls the Net::Http library. We have tracked the problem down the this line of code:

s = timeout(@open_timeout) { TCPSocket.open(conn_address(), conn_port()) }

Look familiar?

The timeout in this line is rendered inconsequential because @open_timeout is nil, but their is a SystemTimer block wrapping all of this up in the application code.

Our problem occurs when the socket takes longer to open than what we set the timer for. We have a 3 second timer, but if the socket takes longer to open, the timer doesn't kill the thread until after it comes back from this call.

We have experienced this behavior on both RedHat Linux 5.0 and CentOS 5.2 on 64 bit machines. We are using version 1.1.1 of the SystemTimer gem. Can you shed any light into why SystemTimer isn't working for us? Based on the documentation, it seems this is the exact scenario the gem was designed for.

Any insight would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment