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

enhancement(cli/consume): improve thread exception handling in cli consumer #5118

Merged
merged 2 commits into from
Aug 22, 2024

Conversation

wssheldon
Copy link
Contributor

Problem

Consumer threads did not get monitored for zombie state and re-initialized. General exception handling around the consumer was not performed and exceptions appear to be swallowed.

Solution

  1. Implements exception handling to prevent thread crashes due to unexpected errors.
  2. Continuously monitors all threads and automatically restarts any that have died.
  3. Improves logging for better visibility into the process's status and any errors encountered.

Error State

Traceback (most recent call last):
...

botocore.exceptions.ClientError: An error occurred (InvalidClientTokenId) when calling the GetQueueUrl operation: The security token included in the request is invalid
DEBUG:https://sqs.us-west-2.amazonaws.com:443 "POST / HTTP/1.1" 403 310:/Users/wshel/.pyenv/versions/3.11.2/envs/dispatch/lib/python3.11/site-packages/urllib3/connectionpool.py:_make_request:547
ERROR:Exception in thread for plugin signal-consumer: An error occurred (InvalidClientTokenId) when calling the GetQueueUrl operation: The security token included in the request is invalid:/Users/wshel/Projects/dispatch/src/dispatch/cli.py:_run_consume_with_exception_handling:827

Copy link
Contributor

@kevgliss kevgliss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@wssheldon wssheldon merged commit 6ede625 into master Aug 22, 2024
9 checks passed
@wssheldon wssheldon deleted the enhancement/cli-consume branch August 22, 2024 18:02
wssheldon added a commit that referenced this pull request Sep 6, 2024
…nsumer (#5118)

* enhancement(cli/consume): improve thread exception handling in cli consumer

* enhancement(cli/consume): improve thread exception handling in cli consumer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants