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


##########
tez-common/src/main/java/org/apache/tez/common/AsyncDispatcher.java:
##########
@@ -148,7 +153,7 @@ protected void serviceStop() throws Exception {
               TezConfiguration.TEZ_AM_DISPATCHER_DRAIN_EVENTS_TIMEOUT_DEFAULT);
 
       synchronized (waitForDrained) {
-        while (!drained && eventHandlingThread.isAlive() && 
System.currentTimeMillis() < endTime) {
+        while (!eventQueue.isEmpty() && eventHandlingThread.isAlive() && 
System.currentTimeMillis() < endTime) {

Review Comment:
   Not related to the change, I just saw this since this line changed, this 
time comparision is wrong, we should not use t1 < t2, because of numerical 
overflow issues, it is there in the System.java javadoc as well
   <img width="700" alt="image" 
src="https://github.com/apache/tez/assets/25608848/e50d47c8-a923-4aac-87c4-3d26f9424695";>
   
   moreover could have explored Time.montonicNow() for these computation which 
is safe from ``settimeofday``, I will create a new ticket to change this, 
unless I am missing some catch here



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