You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/02/24 18:40:42 UTC

[GitHub] [beam] kennknowles commented on a change in pull request #14070: Log a warning when Dataflow returns an unrecognized state

kennknowles commented on a change in pull request #14070:
URL: https://github.com/apache/beam/pull/14070#discussion_r582208556



##########
File path: runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/util/MonitoringUtil.java
##########
@@ -219,6 +220,11 @@ public static String getGcloudCancelCommand(DataflowPipelineOptions options, Str
   }
 
   public static State toState(String stateName) {
-    return MoreObjects.firstNonNull(DATAFLOW_STATE_TO_JOB_STATE.get(stateName), State.UNRECOGNIZED);
+    @Nullable State recognizedState = DATAFLOW_STATE_TO_JOB_STATE.get(stateName);
+    if (recognizedState != null) {
+      return recognizedState;
+    }
+    LOG.warn("Unrecognized state from Dataflow service: {}", stateName);

Review comment:
       Yea good idea. I will update the message. FWIW we could refactor things to somehow get the string out (unfortunately enums are not helpful for attaching it) but since it is pretty rare it isn't worth too much effort yet.




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

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