HappenLee commented on code in PR #42210:
URL: https://github.com/apache/doris/pull/42210#discussion_r1809763318


##########
fe/fe-core/src/main/java/org/apache/doris/common/util/Daemon.java:
##########
@@ -119,9 +119,23 @@ public void run() {
             }
 
             try {
-                Thread.sleep(intervalMs);
+                long oldInterval = intervalMs;
+                long remainingInterval = oldInterval;
+                while (remainingInterval > 5000L) {
+                    // if it changed. let it know at most 10 seconds. and 5 
second per wakeup is acceptable.
+                    if (intervalMs != oldInterval) { // changed
+                        break;
+                    }
+
+                    Thread.sleep(5000L);
+                    remainingInterval -= 5000L;
+                }
+                if (remainingInterval <= 5000L) {
+                    Thread.sleep(remainingInterval);
+                }
             } catch (InterruptedException e) {
-                LOG.info("InterruptedException: ", e);
+                // the daemon thread should NOT be interrupted. or meet bdbje 
writing, it will be disaster.
+                LOG.warn("InterruptedException: ", e);

Review Comment:
   disaster only log warning not fatal?



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

Reply via email to