CodeTrainerMan commented on PR #1224:
URL: https://github.com/apache/flink-agents/pull/1224#issuecomment-6142164606
Thanks @sangkyoonnam — both suggestions are applied and the regression test
now matches your sketch.
1. `execute()`: `this.actionTask = task;` is now bound right after
`pollNextActionTask()` (and the empty-queue `checkState`), so it is non-null on
a preparation failure.
2. `commit()` guard: kept exactly as you suggested —
`if (actionTask != null) {
builtInMetrics.markInputRunFailed(actionTask.getTraceContext().getInputRunId());
}`
It is still required for the failures that happen *before* assignment
(e.g. `pollNextActionTask()` throwing or the empty-queue check failing). With
the early binding, a preparation-phase failure now also carries a non-null task
and still marks the input run failed, so the counter is correct.
Regression test: `preparationFailureKeepsCauseAndMarksInputRunFailed` uses
`operator.addTaskLifecycleListener(...)` with `onActionPrepared` throwing. It
asserts the original cause is preserved (`hasStackTraceContaining("prepare
boom")`) **and** `numOfInputRunsFailed == 1L`. It fails on `1da2fa63` with the
exact NPE you quoted and passes now (5/5 in
`ActionExecutionOperatorParallelMetricsTest`).
The earlier CI "Java format check failed" was only import ordering in the
new test (a non-static import sat below the static imports); fixed via
`spotless:apply`, and `spotless:check` is green.
--
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]