-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 raftState close panic #5016
Conversation
CLA has been signed. |
Seems reasonable to me. |
|
||
if r.closing != nil { | ||
close(r.closing) | ||
r.wg.Wait() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be outside the if?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@corylanou yes,This is not safe, fixed.
Good to go @corylanou ? Thanks @oiooj |
+1. Thanks! |
Thanks again @oiooj |
if meta data directory is not writable,it will panic (I print the error to debug):
and I followed the code:
The raftState is not opened yet, so if you want to close the state, check the
r.closing
first.After fix:
no panic