Skip to content

Set finite OnceCache timeout for OAuth token exchange and refresh#1142

Merged
ericmj merged 1 commit into
mainfrom
ericmj/fix-once-cache-timeout
Apr 14, 2026
Merged

Set finite OnceCache timeout for OAuth token exchange and refresh#1142
ericmj merged 1 commit into
mainfrom
ericmj/fix-once-cache-timeout

Conversation

@ericmj
Copy link
Copy Markdown
Member

@ericmj ericmj commented Apr 13, 2026

Waiters on Hex.OnceCache shared a hardcoded 5s default timeout while the underlying HTTP call can take up to 15s. Under concurrent private package fetches in :hex_fetcher this caused all but the computing task to time out before the token exchange completed.

Use a 60s timeout consistent with Hex.Registry.Server and other HTTP-bound GenServer calls in the codebase. Replace the :infinity timeout in Hex.OAuth with the same bound; the interactive device flow is invoked sequentially from check_and_refresh_auth before parallel fetches begin, so concurrent waiters only ever cover the HTTP refresh path.

Closes #1141.

Waiters on Hex.OnceCache shared a hardcoded 5s default timeout while the
underlying HTTP call can take up to 15s. Under concurrent private package
fetches in :hex_fetcher this caused all but the computing task to time out
before the token exchange completed.

Use a 60s timeout consistent with Hex.Registry.Server and other HTTP-bound
GenServer calls in the codebase. Replace the :infinity timeout in
Hex.OAuth with the same bound; the interactive device flow is invoked
sequentially from check_and_refresh_auth before parallel fetches begin,
so concurrent waiters only ever cover the HTTP refresh path.
@ericmj ericmj merged commit 4370644 into main Apr 14, 2026
20 checks passed
@ericmj ericmj deleted the ericmj/fix-once-cache-timeout branch April 14, 2026 02:12
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.

Timeouts occuring for private packages in :hex_fetcher

1 participant