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

Re-raise the ChangeError to have more context in the logs #78

Closed
wants to merge 1 commit into from

Conversation

sed-i
Copy link
Contributor

@sed-i sed-i commented Sep 12, 2024

Issue

When tenacity finally fails after 15 retries, we have no context in the logs from the service.

Solution

Re-raise the ChangeError to have more context in the logs.

@sed-i sed-i requested a review from a team as a code owner September 12, 2024 20:23
Copy link
Contributor

@PietroPasotti PietroPasotti left a comment

Choose a reason for hiding this comment

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

Raising here means putting the charm in error. are we sure we want that? a less breaking change would be to instead of logger.erroring the message, to logger.exception it and you'd have the context too. I'd feel much more comfortable with that change.

logger.error(
"failed to (re)start worker jobs. This usually means that an external resource (such as s3) "
"that the software needs to start is not available."
)
raise
raise e
Copy link
Contributor

Choose a reason for hiding this comment

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

this behaviour is implicit in python

@PietroPasotti
Copy link
Contributor

incorporated the docstring change in #77

@lucabello lucabello deleted the feature/changeerror branch September 19, 2024 09:00
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.

2 participants