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

Can't reuse sync logger when panic and recovered #973

Closed
sunjayaali opened this issue Apr 12, 2020 · 2 comments · Fixed by #974
Closed

Can't reuse sync logger when panic and recovered #973

sunjayaali opened this issue Apr 12, 2020 · 2 comments · Fixed by #974
Milestone

Comments

@sunjayaali
Copy link

sunjayaali commented Apr 12, 2020

When using sync logger and the given logger panic, that sync logger can't be reuse again because of forever locked mutex.

Can we just defer the Unlock()?

@sunjayaali sunjayaali changed the title Can't reuse logger on sync logger when panic and recovered Can't reuse sync logger when panic and recovered Apr 12, 2020
@peterbourgon
Copy link
Member

Log should never panic, and if it does, you shouldn't recover from it.

But, I have no objection to changing this code to defer the unlock. @ChrisHines?

@ChrisHines
Copy link
Member

Yes, using a defer is fine.

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 a pull request may close this issue.

4 participants