kunwp1 commented on code in PR #9628:
URL: https://github.com/apache/texera/pull/9628#discussion_r4670382922
##########
amber/src/main/scala/org/apache/texera/web/service/ExecutionStatsService.scala:
##########
@@ -207,16 +216,57 @@ class ExecutionStatsService(
client.registerCallback[ExecutionStateUpdate] {
case ExecutionStateUpdate(state: WorkflowAggregatedState.Recognized)
if state == COMPLETED || state == FAILED || state == KILLED =>
- logger.info("Workflow execution terminated. Commit runtime
statistics.")
+ commitAndStop()
+ case _ =>
+ }
+ )
+
+ /**
+ * Commits a run that never reported a terminal state, such as a user kill,
when
+ * WorkflowService tears the service down: at the next run or on session
cleanup. Nothing on
+ * those paths reads the statistics, so the commit finishes in the
background.
Review Comment:
Took your wording in 5fe4b6776; thanks for pointing out the
`DefaultCostEstimator` read.
##########
amber/src/main/scala/org/apache/texera/web/service/ExecutionStatsService.scala:
##########
@@ -338,6 +388,9 @@ class ExecutionStatsService(
)
)
}
+ // A failed run ends here without a terminal state, and the service
is not torn down
+ // until the next run or session cleanup; commit now so the
statistics can be read.
Review Comment:
Took your wording in 5fe4b6776, and renamed the matching test to "...when
the engine reports no terminal state".
--
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]