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(retries): move handle failure code outside of while loop #123

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

nmbryant
Copy link
Contributor

The handle failure code is in the while loop, so after a single failure it will run the _handle_failure function. The retries will still happen if the failure_mode is set to CONTINUE, but if it's set to THROW it will throw an exception after the first failure. With these lines outside of the loop, it will still log when an attempt fails and then once all retries are exhausted it will print the actual failure message and throw and exception if set to THROW mode.

logger.error(
f"Failed to process event after {self._retry_count} retries. event type: {enveloped_event.event_type}, pipeline name: {self.name}. Handling failure..."
)
logger.error(
Copy link

Choose a reason for hiding this comment

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

This is a good catch. Showing the error once outside the loop and incrementing the failure count.
Thank you Nate.

Copy link

github-actions bot commented Sep 10, 2024

Unit Test Results (build & test)

63 tests  ±0   63 ✅ ±0   4s ⏱️ ±0s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 0904d32. ± Comparison against base commit 36aa93e.

♻️ This comment has been updated with latest results.

@hsheth2 hsheth2 merged commit 3da404c into acryldata:main Sep 12, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants