BiteTheDDDDt opened a new pull request, #62891:
URL: https://github.com/apache/doris/pull/62891
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary: A delayed dependency wake_up could race with pipeline task
close/finalize. The old state transition logic validated the current state and
then stored the new state in separate operations, so a stale wake_up could
overwrite FINISHED/FINALIZED back to RUNNABLE after finalize() had already
released `_sink` and `_operators`, making the scheduler resubmit or inspect a
released task.
This PR makes `_state_transition()` publish state changes with CAS. Terminal
FINISHED/FINALIZED -> RUNNABLE remains legal under wake_up_early, but is an
atomic no-op. The uncontended path succeeds with one CAS; only a real
concurrent state change retries and revalidates the transition.
### Release note
None
### Check List (For Author)
- Test: Unit Test
- `./run-be-ut.sh --run
--filter='PipelineTaskTest.TEST_STATE_TRANSITION:PipelineTaskTest.TEST_STATE_TRANSITION_KEEP_FINALIZED_ON_WAKE_UP_RACE'`
- `build-support/check-format.sh`
- `build-support/run-clang-tidy.sh` attempted; it reports pre-existing
diagnostics in `pipeline_task.cpp`, `pipeline_task_test.cpp`, and `jni-util.h`
in this environment.
- Behavior changed: No
- Does this need documentation: No
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]