-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
NullPointerException in NodeImpl#handleRequestVoteRequest #1152
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Sometimes NPE happens in
NodeImpl#handleRequestVoteRequest
on the lineIt happens when we call
o.getTerm()
inin
com.alipay.sofa.jraft.entity.LogId#compareTo
, becauseo
is null. It happens becausereturn null.
The reason of that is because when we
in
com.alipay.sofa.jraft.storage.impl.LogManagerImpl#getLastLogId
, we are in the situation when node is stopping, so this code is calledin
com.alipay.sofa.jraft.storage.impl.LogManagerImpl#offerEvent
. That leads to the situation that we count down latch incom.alipay.sofa.jraft.storage.impl.LogManagerImpl.LastLogIdClosure#latch
, but do not setcom.alipay.sofa.jraft.storage.impl.LogManagerImpl.LastLogIdClosure#lastLogId
Let's discuss a way how to fix it properly. The problem could happen everywhere when we call
com.alipay.sofa.jraft.storage.impl.LogManagerImpl#getLastLogId
orcom.alipay.sofa.jraft.storage.impl.LogManagerImpl#getLastLogIndex(boolean)
The text was updated successfully, but these errors were encountered: