abstractdog commented on code in PR #300:
URL: https://github.com/apache/tez/pull/300#discussion_r1269857814


##########
tez-common/src/main/java/org/apache/tez/common/AsyncDispatcher.java:
##########
@@ -364,10 +369,20 @@ public void handle(Event event) {
       }
       try {
         eventQueue.put(event);
+        if (LOG.isTraceEnabled()) {
+          LOG.trace("AsyncDispatcher put event: {}", event);
+        }
       } catch (InterruptedException e) {
         if (!stopped) {
-          LOG.warn("AsyncDispatcher thread interrupted", e);
+          LOG.warn("AsyncDispatcher thread interrupted (while putting event): 
{}", event, e);
         }
+        // this is needed because in serviceStop we're looping to drain the 
rest of the events and checking !drained
+        // in that case, an interruption here would lead to an empty queue 
with drained=false, leading to
+        // a useless loop with a timeout (this can even cause unit test 
timeouts)
+        drained = eventQueue.isEmpty();
+        LOG.info(
+            "Setting drained to {} due to interruption while putting a new 
event, stopped: {}, blockNewEvents: {}",
+            drained, stopped, blockNewEvents);

Review Comment:
   eh, right, let me try that :)
   NOTE: even if it works, I'll have to check the special meaning of having a 
separate boolean



-- 
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: issues-unsubscr...@tez.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to