-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker::Event.stream documentation should mention how to waive the read_timeout #584
Comments
danschmidt5189
added a commit
to danschmidt5189/docker-api
that referenced
this issue
May 5, 2024
+1 to this. I'm writing a streaming health check event system, and I've been struggling with trying to figure out how to disable the read_timeout. Even if I set it to 0 or a large number it still seems to time out after 4 minutes. A stable production server might have containers running for months with no health change events.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When streaming Docker events, you typically don't want to timeout at all — you want to keep reading forever until your own control logic kicks in to stop streaming. Read timeouts can be disabled in Excon by passing
read_timeout: 0|nil
, but docker-api only supports passing0
: the null-check in compile_request_params strips outread_timeout: nil
, effectively mapping it to the default timeout value (60
).The README currently suggests setting
Docker.options[:read_timeout]
to a very high value, but this is bad for two reasons:I suggest updating the Docker::Event.stream documentation with an example of disabling read timeouts completely.
I would also consider making
read_timeout: 0
the default for that specific method, since that is the least surprising behavior and the one most likely wanted by users. This is a much more significant change, however, and would necessitate at least a minor version update.The text was updated successfully, but these errors were encountered: