Skip to content
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
merged 8 commits into from
Jul 4, 2024

Conversation

ogabrielluiz
Copy link
Contributor

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 the build_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 the end_all_traces call should happen.

These changes improve error handling, resource cleanup, and code quality in the TelemetryService class.

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.
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Jul 3, 2024
@ogabrielluiz ogabrielluiz requested a review from zzzming July 4, 2024 04:03
@ogabrielluiz ogabrielluiz enabled auto-merge (squash) July 4, 2024 04:03
@ogabrielluiz ogabrielluiz requested a review from italojohnny July 4, 2024 11:53
if self.worker_task:
await self.worker_task
self.worker_task.cancel()
Copy link
Contributor

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 ogabrielluiz merged commit 15aa68a into main Jul 4, 2024
29 checks passed
@ogabrielluiz ogabrielluiz deleted the fix/componentdelays branch July 4, 2024 12:24
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 4, 2024
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
Labels
bug Something isn't working lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants