Jackie-Jiang commented on code in PR #16279:
URL: https://github.com/apache/pinot/pull/16279#discussion_r2186119755


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeSegmentDataManager.java:
##########
@@ -1599,9 +1605,17 @@ public void stop()
       throws InterruptedException {
     _shouldStop = true;
     if (Thread.currentThread() != _consumerThread && 
_consumerThread.isAlive()) {
-      // Interrupt the consumer thread and wait for it to join.
+      _segmentLogger.info("Interrupting the consumer thread and waiting for it 
to join");
+      long startTimeMs = System.currentTimeMillis();
       _consumerThread.interrupt();
-      _consumerThread.join();
+      _consumerThread.join(CONSUMER_THREAD_INTERRUPT_INTERVAL_MS);
+      while (_consumerThread.isAlive()) {
+        _segmentLogger.warn("Consumer thread is still alive after {}ms, 
interrupting again",
+            System.currentTimeMillis() - startTimeMs);
+        _consumerThread.interrupt();

Review Comment:
   From the javadoc: `Interrupting a thread that is not alive need not have any 
effect.`, so it should be fine



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