-
Notifications
You must be signed in to change notification settings - Fork 25.7k
ESQL: Fix async operator warnings not always sent when blocking #132744
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 6 commits
b504514
175bb0c
278a69c
4367399
cd99d9c
9f927b2
d5fb394
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,14 @@ | ||
| pr: 132744 | ||
| summary: Fix async operator warnings not always sent when blocking | ||
| area: ES|QL | ||
| type: bug | ||
| issues: | ||
| - 130642 | ||
| - 132554 | ||
| - 132778 | ||
| - 130296 | ||
| - 132555 | ||
| - 131563 | ||
| - 131148 | ||
| - 132604 | ||
| - 128030 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,19 +95,16 @@ public void addInput(Page input) { | |
| driverContext.addAsyncAction(); | ||
| boolean success = false; | ||
| try { | ||
| final ActionListener<Fetched> listener = ActionListener.wrap(output -> { | ||
| buffers.put(seqNo, output); | ||
| onSeqNoCompleted(seqNo); | ||
| }, e -> { | ||
| final ActionListener<Fetched> listener = ActionListener.wrap(output -> buffers.put(seqNo, output), e -> { | ||
| releasePageOnAnyThread(input); | ||
| failureCollector.unwrapAndCollect(e); | ||
| onSeqNoCompleted(seqNo); | ||
| }); | ||
| final long startNanos = System.nanoTime(); | ||
| performAsync(input, ActionListener.runAfter(listener, () -> { | ||
| responseHeadersCollector.collect(); | ||
| driverContext.removeAsyncAction(); | ||
| processNanos.add(System.nanoTime() - startNanos); | ||
| onSeqNoCompleted(seqNo); | ||
| driverContext.removeAsyncAction(); | ||
| })); | ||
| success = true; | ||
| } finally { | ||
|
|
@@ -241,7 +238,7 @@ public IsBlockedResult isBlocked() { | |
|
|
||
| @Override | ||
| public final Operator.Status status() { | ||
| return status(Math.max(0L, checkpoint.getMaxSeqNo()), Math.max(0L, checkpoint.getProcessedCheckpoint()), processNanos.sum()); | ||
| return status(checkpoint.getMaxSeqNo() + 1, checkpoint.getProcessedCheckpoint() + 1, processNanos.sum()); | ||
|
||
| } | ||
|
|
||
| protected Operator.Status status(long receivedPages, long completedPages, long processNanos) { | ||
|
|
||
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.
(Answering you here @dnhatn, as to have a thread)
From what I see, there's already an
if (fetched != null)there on line 170, so no possible NPE, unless you mean something else or I missed something 👀elasticsearch/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/AsyncOperator.java
Lines 165 to 174 in 9f927b2
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.
Thanks Ivan. I took another closer look. I think we are all good.