timoninmaxim commented on code in PR #12179:
URL: https://github.com/apache/ignite/pull/12179#discussion_r2205256243


##########
modules/core/src/main/java/org/apache/ignite/startup/cmdline/CdcCommandLineStartup.java:
##########
@@ -87,14 +88,25 @@ public static void main(String[] args) {
                 });
             }
 
-            Thread appThread = new Thread(cdc.get());
+            appThread = new Thread(cdc.get());
 
             appThread.start();
 
             appThread.join();
         }
         catch (InterruptedException ignore) {
             X.error("CDC was interrupted.");
+
+            if (appThread != null) {
+                appThread.interrupt(); // Interrupting a thread does NOT 
trigger the JVM shutdown hook

Review Comment:
   In unit tests, CDC is started and stopped within the same JVM. Since JVM 
shutdown hooks are not triggered in this scenario, we explicitly interrupt the 
thread to ensure the CDC shuts down cleanly.



-- 
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: notifications-unsubscr...@ignite.apache.org

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

Reply via email to