bobpaulin commented on PR #11886:
URL: https://github.com/apache/nifi/pull/11886#issuecomment-7358343510

   [Claude Opus 5.5] @markap14, I've reworked the PR along the lines you 
suggested.
   
   - `ProcessorNode.start(...)`, `runOnce(...)` and 
`StatelessGroupNode.start(...)` now return the start Future, and the schedulers 
just return it.
   - `SchedulingAgentCallback` is unchanged. The `processorStartFutures` map 
and `completeDeclinedStart` are gone.
   - A start while STARTING, or while STOPPING with `failIfStopping = false`, 
now waits until the Processor is actually running. A stop or disable cancels it.
   - Every stop path now restarts the Processor if the desired state is still 
RUNNING. The restart is submitted through 
`ProcessScheduler.submitFrameworkTask`, so it never runs while the scheduler or 
Processor lock is held. Starting a Processor takes the Process Group lock 
first, so restarting inline from a locked caller could deadlock.
   - Terminate cancels a waiting start instead of restarting the Processor. The 
terminated threads and the stop task can still be running at that point.
   - I adjusted the Processor tests as you described and added 
`testStartWhileStoppingThenTerminatedCancelsStart`. I replaced the mocked 
Stateless test with `TestStandardStatelessGroupNode`, which runs against a real 
`StandardStatelessGroupNode`.
   
   I also ran a manual test against a PostgreSQL CDC Connector, repeating 
start, stop, drain and cancel-drain. Each drain completed, and the Connector 
always went back to STOPPED.


-- 
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]

Reply via email to