fix(fabric): add a timeout to the token initialization request - #4390
Open
tushardev-365 wants to merge 1 commit into
Open
fix(fabric): add a timeout to the token initialization request#4390tushardev-365 wants to merge 1 commit into
tushardev-365 wants to merge 1 commit into
Conversation
_ensure_fabric_token_initialized calls the Fabric workspaces endpoint with requests.get and no timeout. requests waits forever by default, so a stalled connection during credential setup hangs pipeline startup indefinitely instead of failing with a clear error. The workspace API client already follows the convention of a named timeout constant, so this does the same with a class constant.
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.
Description
_ensure_fabric_token_initializedin the Fabric destination calls the workspaces endpoint with no timeout:requests waits forever by default, so a stalled connection during credential setup hangs pipeline startup indefinitely, with no error and nothing in the logs to say why. This runs once per client id on the first load, which is exactly the moment a hang is most confusing to debug.
The fix adds a timeout via a named class constant, following the convention
_ai_context_api_client.pyalready uses (AI_CONTEXT_API_TIMEOUT = 20). A timeout that trips surfaces asrequests.RequestException, and the existingexcepthandling around token initialization deals with it the same way it deals with any other connection failure.No test added since the change is a kwarg passthrough with no behavioral seam to assert beyond the constant itself; happy to add a mock-based assertion that the timeout is passed if you would like one.
Related Issues
None filed.
Additional Context
Third in the series with #4385 and #4389: small hardening of error paths so failures surface as curated errors instead of hangs or leaked exceptions.