mynameborat commented on a change in pull request #1583:
URL: https://github.com/apache/samza/pull/1583#discussion_r806102951



##########
File path: 
samza-core/src/main/java/org/apache/samza/runtime/ContainerLaunchUtil.java
##########
@@ -179,15 +181,26 @@ private static void run(
 
       if (containerRunnerException != null) {
         log.error("Container stopped with Exception. Exiting process now.", 
containerRunnerException);
-        System.exit(1);
+        exitProcess(1);
       }
     } catch (Throwable e) {
-      log.error("Container stopped with Exception. ", 
containerRunnerException);
+      log.error("Exiting the process due to {}. \nContainer runner exception: 
{}", e, containerRunnerException);
+      exitProcess(1);
     } finally {
       coordinatorStreamStore.close();
     }
   }
 
+  @VisibleForTesting
+  static CoordinatorStreamStore buildCoordinatorStreamStore(Config config, 
MetricsRegistryMap metricsRegistryMap) {
+    return new CoordinatorStreamStore(config, metricsRegistryMap);
+  }
+
+  @VisibleForTesting

Review comment:
       I didn't want to go full on refactor this code. For now, I took a stab 
to enable unit testing my changes. 
   Historically, this class has been pain to test and is missing coverage 
citing static & hard to mock code paths. We'd need a dedicated refactor and 
unit testing effort for this but taking the first step to add one.
   




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


Reply via email to