eatmoreduck commented on issue #7274:
URL: https://github.com/apache/incubator-kie/issues/7274#issuecomment-6731711378

   Traced the manual-retry path in the code — the residue lines up with a 
bypass of `AsyncEventNodeInstance`'s own completion cleanup.
   
   What the retrace shows (`main` at `bda36f8`):
   
   1. `POST .../nodeInstances/{nodeInstanceId}` → 
`BaseProcessInstanceManagementResource.doRetriggerNodeInstanceId` → 
`processInstance.retriggerNodeInstance(id)` 
(`AbstractProcessInstance.java:569`).
   2. `NodeInstanceImpl.retrigger(true)` (`NodeInstanceImpl.java:516`) cancels 
the addressed instance, then `retriggerNode(...)` resolves **the actual 
node's** instance via `getNodeInstance(getParentContainer().getNode(nodeId))` 
and triggers it directly.
   3. For an async service task, that direct trigger executes the real 
`WorkItemNode` instance without ever going through 
`AsyncEventNodeInstance.triggerCompleted()` — which is where the wrapper 
removes its event listener, `removeNodeInstance(this)`, restores `STATE_ACTIVE` 
and clears `ASYNC_WAITING` (`AsyncEventNodeInstance.java:188-199`). So whatever 
`AsyncEventNodeInstance` was persisted when the retries were exhausted stays in 
the node-instance collection, and the completion bookkeeping it owns never runs 
— matching the reported ACTIVE-forever instance with the surviving 
`AsyncEventNodeInstance`.
   
   Two details would pin it down before proposing a fix:
   
   - Which retrigger did the reproducer call — the node-level one above, or the 
instance-level `/retrigger` (`retriggerInstanceInError`)? Both end in 
`retriggerNodeInstance`/trigger paths that skip the wrapper's completion, but 
the instance-level one has its own routing I'd want to confirm.
   - Whether the persisted wrapper still holds a live job id — if 
`retrigger(true)`'s `cancel()` on the wrapper didn't reach 
`AsyncEventNodeInstance.cancel` (which cancels the job), there'd also be a 
leaked timer job to clean.
   
   Likely fix shapes: make `retriggerNode` route an async node through the 
wrapper's own completion path (or perform its cleanup when the actual instance 
is retriggered from under it), and make the wrapper's `cancel` remove it from 
the container when the retry restarts the real node. Happy to put a failing 
test + fix together once the API detail above is confirmed.
   


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

Reply via email to