You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by ka...@apache.org on 2024/10/04 01:11:22 UTC
(druid) branch master updated: SuperSorter: Don't set allDone if it's already set. (#17238)
This is an automated email from the ASF dual-hosted git repository.
karan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new b9634a8613d SuperSorter: Don't set allDone if it's already set. (#17238)
b9634a8613d is described below
commit b9634a8613d2cc43181225e3be1118b66e34416d
Author: Gian Merlino <gi...@gmail.com>
AuthorDate: Thu Oct 3 18:11:16 2024 -0700
SuperSorter: Don't set allDone if it's already set. (#17238)
This fixes a race where, if there is no output at all, setAllDoneIfPossible
could be called twice (once when the output partitions future resolves, and
once when the batcher finishes). If the calls happen in that order, it would
try to create nil output channels both times, resulting in a "Channel already set"
error.
---
.../src/main/java/org/apache/druid/frame/processor/SuperSorter.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/processing/src/main/java/org/apache/druid/frame/processor/SuperSorter.java b/processing/src/main/java/org/apache/druid/frame/processor/SuperSorter.java
index b8b74a2b797..8de4c8e8616 100644
--- a/processing/src/main/java/org/apache/druid/frame/processor/SuperSorter.java
+++ b/processing/src/main/java/org/apache/druid/frame/processor/SuperSorter.java
@@ -391,6 +391,11 @@ public class SuperSorter
@GuardedBy("runWorkersLock")
private void setAllDoneIfPossible()
{
+ if (isAllDone()) {
+ // Already done, no need to set allDone again.
+ return;
+ }
+
try {
if (totalInputFrames == 0 && outputPartitionsFuture.isDone()) {
// No input data -- generate empty output channels.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org