-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: make end_all_traces be called at the correct moment #2516
Merged
Conversation
This file contains 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
Handle HTTPStatusError and RequestError exceptions separately in the send_telemetry_data method of TelemetryService to provide more specific error messages. Also, catch any unexpected exceptions and log them with an appropriate error message.
Cancel the worker task and close the client in the stop method of TelemetryService to ensure proper cleanup and prevent potential resource leaks. Also handle any exceptions that may occur during the cleanup process and log appropriate error messages.
… to comply with PEP8 guidelines
…bles list to prevent duplication of results
dosubot
bot
added
size:S
This PR changes 10-29 lines, ignoring generated files.
bug
Something isn't working
labels
Jul 3, 2024
nicoloboschi
approved these changes
Jul 4, 2024
if self.worker_task: | ||
await self.worker_task | ||
self.worker_task.cancel() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good finding. I saw the error message multiple times
ogabrielluiz
added a commit
to yaitec/langflow
that referenced
this pull request
Jul 9, 2024
…#2516) * fix(tracing/service.py): remove wait_for_all_tracers call * refactor: set reasonable timeout for TelemetryService client * fix: handle HTTP and request errors in TelemetryService Handle HTTPStatusError and RequestError exceptions separately in the send_telemetry_data method of TelemetryService to provide more specific error messages. Also, catch any unexpected exceptions and log them with an appropriate error message. * fix: cancel worker task and close client in TelemetryService stop method Cancel the worker task and close the client in the stop method of TelemetryService to ensure proper cleanup and prevent potential resource leaks. Also handle any exceptions that may occur during the cleanup process and log appropriate error messages. * style(telemetry/service.py): fix indentation issue in await statement to comply with PEP8 guidelines * feat(graph): add method to remove vertex from runnables in Graph class * fix(chat.py): fix issue where vertex was not being removed from runnables list to prevent duplication of results * fix(chat.py): defines when the end_all_traces call should happen
nicoloboschi
pushed a commit
to datastax/ragstack-ai-langflow
that referenced
this pull request
Jul 10, 2024
…#2516) * fix(tracing/service.py): remove wait_for_all_tracers call * refactor: set reasonable timeout for TelemetryService client * fix: handle HTTP and request errors in TelemetryService Handle HTTPStatusError and RequestError exceptions separately in the send_telemetry_data method of TelemetryService to provide more specific error messages. Also, catch any unexpected exceptions and log them with an appropriate error message. * fix: cancel worker task and close client in TelemetryService stop method Cancel the worker task and close the client in the stop method of TelemetryService to ensure proper cleanup and prevent potential resource leaks. Also handle any exceptions that may occur during the cleanup process and log appropriate error messages. * style(telemetry/service.py): fix indentation issue in await statement to comply with PEP8 guidelines * feat(graph): add method to remove vertex from runnables in Graph class * fix(chat.py): fix issue where vertex was not being removed from runnables list to prevent duplication of results * fix(chat.py): defines when the end_all_traces call should happen (cherry picked from commit 15aa68a)
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.
This pull request includes several fixes and improvements to the TelemetryService class.
The
send_telemetry_data
method now handles HTTPStatusError and RequestError exceptions separately, providing more specific error messages.The
stop
method now cancels the worker task and closes the client to ensure proper cleanup and prevent resource leaks. It also handles any exceptions that may occur during the cleanup process.An indentation issue in the
await
statement of thebuild_vertex
method has been fixed to comply with PEP8 guidelines.The
remove_vertex_from_runnables
method has been added to the Graph class to remove a vertex from the runnables list.Several fixes have been made in the
chat.py
file to prevent duplication of results and define when theend_all_traces
call should happen.These changes improve error handling, resource cleanup, and code quality in the TelemetryService class.