fix: filter OSError(EADDRINUSE) from PKCE callback bind as user environment error#1199
Open
EngHabu wants to merge 1 commit into
Open
fix: filter OSError(EADDRINUSE) from PKCE callback bind as user environment error#1199EngHabu wants to merge 1 commit into
EngHabu wants to merge 1 commit into
Conversation
…onment error
The PKCE authenticator's local OAuth callback server (pkce.py
_create_callback_server) binds the redirect-URI port via
asyncio.start_server. When that port is already in use — a stale or
concurrent login flow, or another local process holding it — bind raises
OSError(EADDRINUSE), which leaks to Sentry bare or wrapped as
RuntimeSystemError('Failed to get signed url...').
The redirect-URI port comes from the backend's config, so the SDK can't
pick a different one; freeing the port is a user-environment action, not
an SDK bug. Add errno.EADDRINUSE to _USER_ENVIRONMENT_OSERROR_ERRNOS so
it's filtered like ENOSPC, and cover both the bare and wrapped chain.
fixes FLYTE-SDK-53
fixes FLYTE-SDK-57
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>
6ad9def to
28d9ff2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The PKCE authenticator opens a local OAuth callback server (
pkce.py::_create_callback_server) that binds the redirect-URI port viaasyncio.start_server. When that port is already in use — a stale or concurrent login flow, or another local process holding it — bind raisesOSError(EADDRINUSE)("[Errno 98] address already in use"), which leaks to Sentry either bare or wrapped asRuntimeSystemError("Failed to get signed url...").The redirect-URI port comes from the backend config, so the SDK cannot pick a different one; freeing the port is a user-environment action, not an SDK bug.
Change
errno.EADDRINUSEto_USER_ENVIRONMENT_OSERROR_ERRNOSinflyte/_sentry.pyso the cause-chain walk in_is_user_errorfilters it, same asENOSPC.RuntimeSystemError-wrapped chain.fixes FLYTE-SDK-53
fixes FLYTE-SDK-57
🤖 Generated with Claude Code