Skip to content

fix(fabric): add a timeout to the token initialization request - #4390

Open
tushardev-365 wants to merge 1 commit into
dlt-hub:develfrom
tushardev-365:fix/fabric-token-request-timeout
Open

fix(fabric): add a timeout to the token initialization request#4390
tushardev-365 wants to merge 1 commit into
dlt-hub:develfrom
tushardev-365:fix/fabric-token-request-timeout

Conversation

@tushardev-365

Copy link
Copy Markdown
Contributor

Description

_ensure_fabric_token_initialized in the Fabric destination calls the workspaces endpoint with no timeout:

resp = requests.get("https://api.fabric.microsoft.com/v1/workspaces", headers=headers)

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.py already uses (AI_CONTEXT_API_TIMEOUT = 20). A timeout that trips surfaces as requests.RequestException, and the existing except handling 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.

_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.
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