fix: evaluate activation conditions outside the workflow executor's monitor - #3626
afalhambra-hivemq wants to merge 2 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
542a697 to
6313ad4
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Aligns reconcile execution with delete/cleanup paths by moving activation/precondition evaluation and event source registration out from under the WorkflowReconcileExecutor monitor to reduce blocking while holding the lock.
Changes:
- Moved activation condition + event source register/deregister into
NodeReconcileExecutor.doRun - Added
unmarkAsExecutinghelper to support the “conditions not met” cascade semantics - Added a test to ensure activation condition isn’t evaluated on the reconciling thread
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/dependent/workflow/WorkflowReconcileExecutorTest.java | Adds a regression test asserting activation conditions run off the reconciling thread |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/workflow/WorkflowReconcileExecutor.java | Moves condition evaluation + event source registration out of the monitor and adjusts “not met” path |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/workflow/AbstractWorkflowExecutor.java | Introduces unmarkAsExecuting helper for early execution relinquish |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
6313ad4 to
f6da6d7
Compare
f6da6d7 to
1ab4887
Compare
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved blocking issues remain; the test-coverage comment is a minor nit.
Review details
Suppressed comments (1)
operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/dependent/workflow/WorkflowReconcileExecutorTest.java:787
- The added regression test only rendezvous inside
Condition; it never blocksdynamicallyRegisterEventSourceor an event source'sstart(). As a result, the suite would still pass if the registration call were accidentally moved back under the executor monitor, even though that is the blocking operation behind #3617. Please add a test event source whose startup blocks until a second activation-conditioned dependent reaches the same rendezvous.
void activationConditionsEvaluatedConcurrently() {
// they can only meet at the barrier if neither of them holds the executor's monitor
var rendezvousCondition = rendezvousCondition(new CyclicBarrier(2));
- Files reviewed: 4/4 changed files
- Comments generated: 0 new
- Review effort level: Lite
…onitor Signed-off-by: Antonio Fernandez Alhambra <antonio.alhambra@hivemq.com>
Signed-off-by: Antonio Fernandez Alhambra <antonio.alhambra@hivemq.com>
1ab4887 to
e8a5562
Compare
Moves the activation condition evaluation and the event source register/deregister out of
handleReconcileand intoNodeReconcileExecutor, so the blocking informer sync no longer happens while the executor's monitor is held. The delete and cleanup paths already work this way.A node whose activation or reconcile precondition does not hold defers its delete cascade to
onNodeExecutionFinished, a new hook that runs with the monitor held, right after the node's execution mark is cleared. Work scheduled from there carries its own mark, soreconcile()cannot return while a delete it scheduled is still running.Two behaviour notes:
reconcile()raw. This changesgetErroredDependents()keys.The second commit is unrelated cleanup, happy to drop it.
Fixes #3617