-
Notifications
You must be signed in to change notification settings - Fork 4.6k
[Dataflow Streaming] [Multi Key] Drop failed work in BoundedQueueExecutor::pollWork #38920
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
base: master
Are you sure you want to change the base?
Changes from all commits
2c12786
3670a03
546739c
2ddc10e
fc15302
7938f7f
ebfe88a
fce54b0
840ecda
bbda033
bc9b4d0
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 |
|---|---|---|
|
|
@@ -395,12 +395,21 @@ BoundedQueueExecutorWorkHandleImpl createBudgetHandle(Work work, long bytes) { | |
| if (keyGroupWorkQueue == null) { | ||
| return null; | ||
| } | ||
| @Nullable QueuedWork queuedWork = keyGroupWorkQueue.pollWork(computationId, keyGroup); | ||
| if (queuedWork == null) { | ||
| return null; | ||
| while (true) { | ||
| @Nullable QueuedWork queuedWork = keyGroupWorkQueue.pollWork(computationId, keyGroup); | ||
| if (queuedWork == null) { | ||
| return null; | ||
| } | ||
| Work work = queuedWork.getWork().work(); | ||
| if (work.isFailed()) { | ||
| queuedWork.getHandle().close(); | ||
| work.getComputationState() | ||
|
Contributor
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. I'm wondering if there is someway to make the control flow clearer for these work items. One idea would be to not handle the failure here but pass the failed work items back to the caller of poll. Then StreamingWorkExecutionContext could possibly have a abortedworkitemhhandler similar to the KeyTransitionListener. Then we can have consistent error handling to StreamingWorkScheduler.handleProcessWorkFailure by passing it in instead of duplicating what it does. Or perhaps we could collect the failed work in StreamingWorkExecutionContext and then handle it later after execution completes instead of using an injected function. |
||
| .completeWorkAndScheduleNextWorkForKey(work.getShardedKey(), work.id()); | ||
| continue; | ||
| } | ||
| internalHandle.merge(queuedWork.getHandle()); | ||
| return queuedWork.getWork(); | ||
| } | ||
| internalHandle.merge(queuedWork.getHandle()); | ||
| return queuedWork.getWork(); | ||
| } | ||
|
|
||
| private void decrementCounters(int elements, long bytes) { | ||
|
|
||
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.
this is just updating the counters, but it is not updating that this key was scheduled for processing. I think that somehow ActiveWorkState.completeWorkAndGetNextWorkForKey needs to be called so that we note that this key is completed and other work for the key can schedule.
Maybe a unit test at a higher level would help verify this behavior is working properly.
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 for catching it. Will fix it with a test, after #38814 is merged