maytasm commented on a change in pull request #10467:
URL: https://github.com/apache/druid/pull/10467#discussion_r500518971



##########
File path: 
core/src/main/java/org/apache/druid/data/input/impl/TimedShutoffInputSourceReader.java
##########
@@ -131,6 +134,7 @@ public void close() throws IOException
         shutoffTime.getMillis() - System.currentTimeMillis(),
         TimeUnit.MILLISECONDS
     );
+    exec.shutdown();

Review comment:
       This is necessary to shutdown the `exec` created in this class. 
Previously it was being shutdown via the registering with the Closer. However, 
that is bad form since the Closer can be executed by a thread in this `exec`. I 
removed the shutdown of this `exec` from the Closer and added this line. This 
means that the scheduled task (which calls the iterator.close() method will 
always run), which is ok since we have the atomic boolean to ensure that the 
iterator.close() is idempotent. After the task ran then the `exec` will just 
automatically close. This no longer relies on the Closer, the thread in the 
`exec` or the iterator.close(). 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to