phet commented on code in PR #4038:
URL: https://github.com/apache/gobblin/pull/4038#discussion_r1736948757
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/proc/ReevaluateDagProc.java:
##########
@@ -81,6 +81,11 @@ protected void act(DagManagementStateStore
dagManagementStateStore, Pair<Optiona
JobStatus jobStatus = dagNodeWithJobStatus.getRight().get();
ExecutionStatus executionStatus =
ExecutionStatus.valueOf(jobStatus.getEventName());
+ // get the dag before updating dag node's status because after updating
status, dag may be considered "complete" and
+ // may get cleaned up by other Reevaluate DagProc
+ Dag<JobExecutionPlan> dag =
dagManagementStateStore.getDag(getDagId()).get();
+ dag.getNodes().stream().filter(node ->
node.getValue().getId().equals(getDagNodeId())).findFirst().get().getValue()
Review Comment:
would it be worth a check here that `findFirst()` did actually match this
dagNodeId? that would be far clearer in the logs than the resulting
exception's error message if the optional were not actually present
--
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]