Skip to content

Conversation

@robotrapta
Copy link
Member

@robotrapta robotrapta commented Feb 14, 2024

Fixes #167 - it could take over 8 minutes for an API connection to timeout if nothing's listening.

Copy link
Collaborator

@brandon-wada brandon-wada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. it feels like it would be nice to somehow change the default _request_timeout in the detectors_api and image_queries_api so we don't have to invoke the timeout parameter inside client.py, but thats more aesthetics than function

@robotrapta
Copy link
Member Author

I thought about exposing an environment variable to set the default timeout. But it adds complexity, and I think it would be used extremely rarely. The standard TCP/IP timeout values were set in the 1980s or so, when networks were extremely slow and unreliable, so it made sense to keep trying for 30 seconds to reach a remote server. Today, that's insane, but many systems still use those classic timeout values. Even at 5 seconds, the only place I can imagine a connection succeeding after longer than that would be on an airplane with sketchy connectivity, for example. It's conceivable, but crazy rare. So I don't think it's worth the complexity to even expose it.

@robotrapta robotrapta merged commit 38179fb into main Feb 14, 2024
@robotrapta robotrapta deleted the faster-timeout branch February 14, 2024 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Absurdly long timeout if host unreachable

3 participants