MSQ: Wake up the main controller thread on workerError. (#17075) (#17304)

[Backport] MSQ: Wake up the main controller thread on workerError. (#17075) #17304 
This isn't necessary when using MSQWorkerTaskLauncher as the WorkerManager
implementation, because in that case, task failure also wakes up the
main thread. However, when using workers that are not task-based, we don't
want to rely on the WorkerManager for this.

Co-authored-by: Gian Merlino <gianmerlino@gmail.com>
This commit is contained in:
AmatyaAvadhanula 2024-10-09 19:09:06 +05:30 committed by GitHub
parent 9b42fb1c65
commit 709c119907
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -117,6 +117,7 @@ import org.apache.druid.msq.indexing.error.TooManyBucketsFault;
import org.apache.druid.msq.indexing.error.TooManySegmentsInTimeChunkFault;
import org.apache.druid.msq.indexing.error.TooManyWarningsFault;
import org.apache.druid.msq.indexing.error.UnknownFault;
import org.apache.druid.msq.indexing.error.WorkerFailedFault;
import org.apache.druid.msq.indexing.error.WorkerRpcFailedFault;
import org.apache.druid.msq.indexing.processor.SegmentGeneratorFrameProcessorFactory;
import org.apache.druid.msq.indexing.report.MSQSegmentReport;
@ -752,6 +753,11 @@ public class ControllerImpl implements Controller
}
workerErrorRef.compareAndSet(null, mapQueryColumnNameToOutputColumnName(errorReport));
// Wake up the main controller thread.
addToKernelManipulationQueue(kernel -> {
throw new MSQException(new WorkerFailedFault(errorReport.getTaskId(), null));
});
}
/**