Repository navigation
Conversation
Hey @shardtVLH! 🎉Thanks for opening your first pull request. We really appreciate it. 👉 Please confirm by writing this comment that your contribution and following ones comply with the Apache License 2.0 and the Code of Conduct:
Consider adding a star ⭐️ to the repository if you like it, we appreciate that. Contributors will be added to the release notes of the next release. |
- ensureExecutionTreeInitialized throws OptimisticLockingException instead of NullPointerException when the process instance was deleted concurrently - job executor retries without decrementing retries and skips the deleted job - add concurrency test with timer inside embedded subprocess related to operaton#4017 Assisted-by: Claude Code:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <[email protected]>
4d158b9 to
bc1bc01
Compare
|
Hi @shardtVLH, thanks a lot for the report and this fix! I'll look into it, much appreciated |
javahippie
left a comment
There was a problem hiding this comment.
Thanks for the fix and the reproducer test!
No breaking change from my side: no public signatures change, and the new branch only replaces a path that always threw an NPE before. The visible effects (no incident, no retry decrement, DEBUG instead of ERROR logging, OLE error code via REST) are the intended behavior.
A few remarks:
- Non-prefetch path: With
executionTreePrefetchEnabled=false,ensureProcessInstanceInitializedusesfindExecutionById(processInstanceId), which returnsnullfor a deleted process instance. The NPE then occurs later in the caller ofgetProcessInstance(). Could you handle this path the same way, so the behavior does not depend on configuration? - Test scope: The test verifies the exception type. The PR description also states that retries are not decremented and no incident is created. A test via job execution would cover that, if feasible.
- Nit: Static import order in the test (
org.assertjbeforeorg.operaton). Running.devenv/scripts/maintenance/code-cleanup.shshould fix this.
- ensureProcessInstanceInitialized throws OptimisticLockingException when the process instance is not found and execution tree prefetch is disabled - run the deletion test with execution tree prefetch enabled and disabled - add test that executes the timer job with failed job handling and checks that the deleted job causes no incident related to operaton#4017 Assisted-by: Claude Code:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks for the review! I pushed a follow-up commit:
|
|
I confirm that my contribution and following ones comply with the Apache License 2.0 and the Code of Conduct. |
|
Hi @javahippie, friendly ping: I addressed your review points in 5e46da0 (non-prefetch path and job-based test). CI is green and the branch merges cleanly into current |
Summary
Fixes #4017.
ExecutionEntity.ensureExecutionTreeInitializedthrew aNullPointerExceptionwhen the processinstance had been deleted by a concurrent transaction after the current execution was loaded
(e.g. a timer job inside an embedded subprocess while the process instance is deleted). The
execution tree query returns no rows, so no process instance execution is found. With
executionTreePrefetchEnabled=false,getProcessInstance()returnednullinstead and the NPEoccurred later in the caller.
Both paths now throw an
OptimisticLockingException(newENGINE-03111inEnginePersistenceLogger).The failed job handling then skips the job that no longer exists instead of creating an incident.
OLEs do not decrement job retries.
Changes
ExecutionEntity.ensureExecutionTreeInitialized: throwOptimisticLockingExceptionif no processinstance execution is found
ExecutionEntity.ensureProcessInstanceInitialized: same when prefetch is disabled and the processinstance is not found
EnginePersistenceLogger.processInstanceDeletedConcurrently(code111)CompetingProcessInstanceDeletionTest(each test with prefetch enabled and disabled):test thread, then loads the process instance
ExecuteJobHelperafter loading its execution, deletes the processinstance concurrently, and checks that the job fails with an OLE without creating an incident
Testing
NullPointerExceptionand pass with itmvn -pl engine test -Dtest=org.operaton.bpm.engine.test.concurrency.*Test: 69 tests, 0 failurestest.bpmn.**andtest.api.runtime.**withexecutionTreePrefetchEnabled=falsein the testconfiguration (local run, not committed): 3499 tests, 1 failure (
SignalEventConcurrencyTest), which also fails without this change🤖 Generated with Claude Code