Skip to content

Give up on a vendor after 10 seconds, not a minute - #3

Merged
henrikbjorn merged 1 commit into
mainfrom
request-timeouts
Nov 19, 2026
Merged

henrikbjorn merged 1 commit into
mainfrom
request-timeouts

Conversation

@henrikbjorn

Copy link
Copy Markdown
Member

The oauth2 and oauth gems leave Net::HTTP's defaults of 60 seconds to connect and 60 to read, so a hung token endpoint could hold a sign-in or a refresh for a minute or more. OmniAuth behaves the same.

OAuth2 (and so every OAuth 2 and OpenID Connect strategy) now passes connection_opts: { request: { open_timeout: 5, timeout: 10 } } to OAuth2::Client, covering the code exchange, refresh and identity calls. OAuth1 passes open_timeout: 5, timeout: 10 to OAuth::Consumer. A strategy's client_options still win, so a vendor that needs longer can set its own. SAML, e-conomic and Adversus make no requests.

A timeout already surfaces as Unavailable. The changelog has it under Unreleased, for 0.2.1.

The oauth2 and oauth gems leave Net::HTTP's defaults of 60 seconds to connect and 60 to read, so a hung token endpoint held a sign-in or a refresh for a minute or more. Both strategies now default to 5 seconds connecting and 10 answering; a strategy's client_options can still set its own.
@henrikbjorn
henrikbjorn merged commit a437550 into main Nov 19, 2026
3 checks passed
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.

1 participant