Skip to content

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

@kevintyll

Description

@kevintyll

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions