gianm commented on code in PR #20321:
URL: https://github.com/apache/druid/pull/20321#discussion_r4484343394
##########
multi-stage-query/src/main/java/org/apache/druid/msq/querykit/ChainedProcessorManager.java:
##########
@@ -129,12 +169,18 @@ public R result()
@Override
public void close()
{
- if (!closed) {
+ synchronized (lock) {
+ if (closed) {
+ return;
+ }
closed = true;
- CloseableUtils.closeAndWrapExceptions(() -> CloseableUtils.closeAll(
- first,
- restFuture.isDone() ? FutureUtils.getUnchecked(restFuture, false) :
null
- ));
}
+
+ // Close outside the lock: restFuture can no longer change, since
checkFirstProcessorComplete() does nothing
+ // once closed.
+ CloseableUtils.closeAndWrapExceptions(() -> CloseableUtils.closeAll(
+ first,
+ restFuture.isDone() ? FutureUtils.getUnchecked(restFuture, false) :
null
Review Comment:
Restored close-time cancellation of `restFuture`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]