-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Forbid null
ack timeout
#107653
Forbid null
ack timeout
#107653
Conversation
Today a cluster state update task with `null` ack timeout implies the timeout is zero. This implicit behaviour is trappy, so this commit forbids it. Relates elastic#107044
Pinging @elastic/es-distributed (Team:Distributed) |
@@ -706,6 +706,7 @@ private static class TaskAckListener { | |||
public void onCommit(TimeValue commitTime) { | |||
TimeValue ackTimeout = contextPreservingAckListener.ackTimeout(); | |||
if (ackTimeout == null) { | |||
assert false : "ackTimeout must always be present: " + contextPreservingAckListener; | |||
ackTimeout = TimeValue.ZERO; |
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.
Should we forbid this when running without assertions as well?
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.
I'm inclined to leave the production behaviour alone, for now at least. It's hard to be certain we've covered all the possible null
values here by static analysis alone.
Today a cluster state update task with
null
ack timeout implies thetimeout is zero. This implicit behaviour is trappy, so this commit
forbids it.
Relates #107044