Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

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
@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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants