Feature/heartbeat transaction - #88
Conversation
There was a problem hiding this comment.
Lines repeted each time, should we move it on the onMessage function??
There was a problem hiding this comment.
I agree that the guard is repeated. I would move only replicaStatus == CRASHED into onMessage path. I would keep heartbeatTransaction == null heartbeat-specific, because onMessage also handles other messages.
There was a problem hiding this comment.
After merging #81 will be removed completely the method, and di per se there is no error if we don't check the non-null value of the heartbeatTransaction
There was a problem hiding this comment.
I agree that the guard is repeated. I would move only replicaStatus == CRASHED into onMessage path. I would keep heartbeatTransaction == null heartbeat-specific, because onMessage also handles other messages.
| // The scheduled timeout has fired, so no active scheduled timeout remains. | ||
| timeout = null; | ||
|
|
||
|
|
There was a problem hiding this comment.
When the watchdog timer fires, line 262 changes the state to ELECTION_REQUESTED, but timeout still points to the timer that has already finished. Current behavior seems fine, but setting timeout = null here would make it clear that no timer is active anymore. Could we keep that line?
There was a problem hiding this comment.
This is violating the Static Code Analysis, if is not strict necessary I would remove it, if you think is necessary a better solution will be to change it from Cancellable to Optional<Cancellable> and use this API.
There was a problem hiding this comment.
If you find other occurences of this "error" please telll me!
There was a problem hiding this comment.
It is actually fine, we can remove it
Tech-Matt
left a comment
There was a problem hiding this comment.
Good job, no new feedback from me. We can merge!
I fixed some static code analysis errors and applied the styling convention