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

Handle retry attempts better: print exception and stack trace #1555

Merged
merged 4 commits into from
May 14, 2023

Conversation

JosselinSomervilleRoberts
Copy link
Contributor

Solving #1471
I tried also to handle KeyboardInterrupt but is is not super consistent.

Copy link
Collaborator

@yifanmai yifanmai left a comment

Choose a reason for hiding this comment

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

Awesome!

src/helm/proxy/retry.py Outdated Show resolved Hide resolved
src/helm/proxy/retry.py Outdated Show resolved Hide resolved
src/helm/common/hierarchical_logger.py Outdated Show resolved Hide resolved
src/helm/proxy/retry.py Outdated Show resolved Hide resolved
@JosselinSomervilleRoberts
Copy link
Contributor Author

I've made the changes, thanks @yifanmai for sharing the way to print the rror. Works fine now.

src/helm/common/hierarchical_logger.py Outdated Show resolved Hide resolved
# The lock is used to prevent multiple threads from printing at the same time.
# This can cause issues when printing the stack trace.
# (The stack traces can get mixed up and become unreadable.)
print_lock: threading.Lock = threading.Lock()
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is okay, but note: the stack trace logging may still be interleaved with other logging, and this is expected behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I know, it's just so that there a not 2 stacks traces at the same time

@JosselinSomervilleRoberts JosselinSomervilleRoberts deleted the josselin-stack-trace branch May 14, 2023 17:38
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