-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Interpret ?timeout=-1 as infinite ack timeout
#107675
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
Changes from all commits
3942bdb
3377636
7f4aab3
33b87f6
fc0854e
cb88b5d
3a557e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| pr: 107675 | ||
| summary: Interpret `?timeout=-1` as infinite ack timeout | ||
| area: Cluster Coordination | ||
| type: breaking | ||
| issues: [] | ||
| breaking: | ||
| title: Interpret `?timeout=-1` as infinite ack timeout | ||
| area: REST API | ||
| details: | | ||
| Today {es} accepts the parameter `?timeout=-1` in many APIs, but interprets | ||
| this to mean the same as `?timeout=0`. From 8.15 onwards `?timeout=-1` will | ||
| mean to wait indefinitely, aligning the behaviour of this parameter with | ||
| other similar parameters such as `?master_timeout`. | ||
| impact: | | ||
| Use `?timeout=0` to force relevant operations to time out immediately | ||
| instead of `?timeout=-1` | ||
| notable: false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -711,6 +711,14 @@ public void onCommit(TimeValue commitTime) { | |
| assert false : "ackTimeout must always be present: " + contextPreservingAckListener; | ||
| ackTimeout = TimeValue.ZERO; | ||
| } | ||
|
|
||
| if (ackTimeout.millis() < 0) { | ||
| if (countDown.countDown()) { | ||
| finish(); | ||
| } | ||
| return; | ||
|
Comment on lines
+715
to
+719
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really related to this PR but for my learning. I am trying to understand the sequence of how cluster state happens. Is the following order correct?
When step 2 completes and all nodes responded in step 4, the overall request is considered as acknowledged. Reading the code here, it seems to me that when
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The sequence is right. You could be right about In particular, it's hard to see that As written, you could have the committing thread setting
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks a lot for the explanation. TIL 🙇 |
||
| } | ||
|
|
||
| final TimeValue timeLeft = TimeValue.timeValueNanos(Math.max(0, ackTimeout.nanos() - commitTime.nanos())); | ||
| if (timeLeft.nanos() == 0L) { | ||
| onTimeout(); | ||
|
|
||
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.
It would be great to also explain how
master_timeoutis computed. By reading the code, it seems to start when the task is added to the queue and expires if the task does not get processed by the master. And I believe during this waiting, the task is visible via the PendingTasks API?