SEZ9 commented on PR #12156: URL: https://github.com/apache/seatunnel/pull/12156#issuecomment-7024354983
@CryoThrust thanks for the detailed follow-up. **Second read in `cancelJob()`**: You're right, and I withdraw my suggestion to reuse the first snapshot. Deciding from it would send a job that started in between straight to `CANCELED` instead of draining its pipelines through `CANCELING`. Restoring the second read after the terminal guard is the correct behaviour, and the new test that fails with `CANCELING` expected and `CANCELED` observed is the right regression for it. One thing to confirm: is the null-state path (state missing from the map) now the same as it was before this PR? **Check-then-act outside the monitor**: Agreed that this PR does not make the check and the transition atomic, and that this race predates the change. I'm fine leaving it to the separate issue you referenced, so nothing more is needed here. **Tests**: The diverging-read case covers what I was missing, since it exercises the `NOT_STARTED_STATUSES` decision in `PhysicalPlan` rather than only the enum table. I didn't see a reply on the second half of that point: could the guard test in `JobStatusTest` carry a short comment or assertion message telling a future contributor what to review when it fails? **Javadoc**: I didn't see a reply on this one either. Please add a short Javadoc on `NOT_STARTED_STATUSES` tying it to the state machine, and trim the inline comments at the two call sites so they don't repeat the set contents. Remaining asks: 1. Confirm the null-state behaviour in `cancelJob()` is unchanged. 2. Add the failure guidance to the guard test. 3. Add the Javadoc on `NOT_STARTED_STATUSES` and de-duplicate the call-site comments. Once those are in and the fresh CI run for this revision has finished, I'll take another look. <!-- streview-comment:2464 --> -- 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]
