fix: add bounded timeout to Jina auth credential validation#37537
Open
ifer47 wants to merge 1 commit into
Open
fix: add bounded timeout to Jina auth credential validation#37537ifer47 wants to merge 1 commit into
ifer47 wants to merge 1 commit into
Conversation
Jina credential validation delegates to the pooled HTTP client without an explicit timeout. A slow or hanging Jina endpoint can stall credential validation indefinitely. Add a bounded httpx.Timeout (10s read, 3s connect) consistent with other auth provider patterns, and update test assertions to verify the timeout is passed. Fixes langgenius#37524 Co-Authored-By: zhipu/glm-5 <zai-org@claude-code-best.win>
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.
Summary
JinaAuth._post_requestused the default unbounded timeout from the pooledhttpx.Client, meaning credential validation could hang indefinitely on network issueshttpx.Timeout(10.0, connect=3.0)constant (matching the pattern used across Dify) and pass it to the POST requestCloses #37524
Test plan
test_should_validate_valid_credentials_successfullyto assert the timeout parametertest_should_pass_bounded_timeout_to_credential_validationtest🤖 Generated with Claude Code Best