The code/documentation for Thin suggests that the default connection timeout is 30s. However, when I try to test this, it doesn’t seem to work. What am I missing?
I’m using thin v1.5.0 (the latest).
# Test this using: curl -X GET http://localhost:3000/test. You will find that the request does not
# timeout after 30s.
require 'thin'
class SimpleAdapter
def call(env)
sleep 100
body = ["hello!"]
[
200,
{ 'Content-Type' => 'text/plain' },
body
]
end
end
server = Thin::Server.new('127.0.0.1', 3000) do
map '/test' do
run SimpleAdapter.new
end
end
server.start!
The inline documentation states the following:
And Thin correctly displays that behavior, that is, if you telnet into the server:
and wait for 30 seconds, it drops the connection. However, the cURL command already sends a complete HTTP request to the Thin server, which is why the timeout waiting for incoming data is never reached.