m-trieu commented on code in PR #31504:
URL: https://github.com/apache/beam/pull/31504#discussion_r1634144471


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingDataflowWorker.java:
##########
@@ -615,8 +676,37 @@ public static void main(String[] args) throws Exception {
     }
 
     JvmInitializers.runBeforeProcessing(options);
-    worker.startStatusPages();
-    worker.start();
+    try {
+      worker.startStatusPages();
+      worker.start();
+    } catch (Throwable e) {
+      LOG.error("Harness shutting down due to uncaught exception.", e);
+      worker.stop();
+    }
+  }
+
+  private static void validateWorkerOptions(DataflowWorkerHarnessOptions 
options) {
+    Preconditions.checkArgument(
+        options.isStreaming(),
+        "%s instantiated with options indicating batch use",
+        StreamingDataflowWorker.class.getName());
+
+    Preconditions.checkArgument(
+        !DataflowRunner.hasExperiment(options, BEAM_FN_API_EXPERIMENT),
+        "%s cannot be main() class with beam_fn_api enabled",
+        StreamingDataflowWorker.class.getSimpleName());
+  }
+
+  private static boolean isDirectPathPipeline(DataflowWorkerHarnessOptions 
options) {
+    boolean isIpV6Enabled = 
options.getDataflowServiceOptions().contains(ENABLE_IPV6_EXPERIMENT);
+    if (options.isEnableWindmillServiceDirectPath() && !isIpV6Enabled) {

Review Comment:
   done



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