Fix: langfuse connection error handling #12621#12626
Merged
KevinHuSh merged 1 commit intoinfiniflow:mainfrom Jan 15, 2026
Merged
Fix: langfuse connection error handling #12621#12626KevinHuSh merged 1 commit intoinfiniflow:mainfrom
KevinHuSh merged 1 commit intoinfiniflow:mainfrom
Conversation
Wrap langfuse.auth_check() calls in try-except blocks to handle connection errors gracefully. This prevents the application from crashing when langfuse service is unavailable or connection is refused, allowing the application to continue functioning without langfuse tracing. Fixes infiniflow#12621
Contributor
Author
|
@KevinHuSh I am glad to contribute to your repo, could you please take a look my first pr? |
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
Fixes connection error handling when langfuse service is unavailable. The application now gracefully handles connection failures instead of crashing.
Changes
langfuse.auth_check()calls in try-except blocks in:api/db/services/dialog_service.pyapi/db/services/tenant_llm_service.pyProblem
When langfuse service is unavailable or connection is refused,
langfuse.auth_check()throwshttpx.ConnectError: [Errno 111] Connection refused, causing the application to crash during document parsing or dialog operations.Solution
Added try-except blocks around
langfuse.auth_check()calls to catch connection errors and gracefully skip langfuse tracing instead of crashing. The application continues functioning normally even when langfuse is unavailable.Related Issue
Fixes #12621
Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=158349177