Skip to content

fix(embedded): clean up a failed service task delivery even if reporting the failure fails - #174

Merged
emaarco merged 1 commit into
developfrom
emaarco/embedded-pull-delivery-never-re-delivers-a-servi
Nov 26, 2026
Merged

emaarco merged 1 commit into
developfrom
emaarco/embedded-pull-delivery-never-re-delivers-a-servi

Conversation

@emaarco

@emaarco emaarco commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Why

When a service task handler throws and reporting that failure to the engine fails too (e.g. the database is down), the task is never run again. The adapter still remembers it as "delivered" and skips it every time the engine offers it again, so the task stays locked by this worker until the application restarts: no retry, no incident, no log. The same happens when the handler throws an Error instead of an Exception.

What

  • A failed delivery is always cleaned up (cleanupFailedDelivery from fix(cib7-embedded): align failed service task delivery with the other adapters #176: deactivate the subscription and call the termination handler), also when reporting the failure throws. The engine then offers the task again and it is delivered again.
  • If reporting the failure throws, the error is logged (…-048).
  • An Error thrown by the handler (e.g. NoClassDefFoundError) is reported as a failure like an Exception.

This is a 1:1 port of the Camunda 7 fix (bpm-crafters/process-engine-adapters-camunda-7#318).

Verification

  • Two new tests in EmbeddedPullServiceTaskDeliveryThreadingTest: the handler sees CREATE → DELETE → CREATE → DELETE when reporting fails, and an Error is reported with decremented retries. Both fail on develop and pass with the fix.
  • ./mvnw verify for cib-seven-embedded-core (82 tests) and cib-seven-embedded-spring-boot-starter (25 tests) pass; the threading test class passed 6 of 6 repeated runs.

Out of scope / Follow-ups

Refs bpm-crafters/process-engine-adapters-camunda-7#316

@emaarco
emaarco force-pushed the emaarco/embedded-pull-delivery-never-re-delivers-a-servi branch from 971ba71 to 4794924 Compare November 26, 2026 12:16
@emaarco emaarco changed the title fix(embedded): deliver a service task again once the engine offers it again fix(embedded): clean up a failed service task delivery even if reporting the failure fails Nov 26, 2026
@emaarco
emaarco force-pushed the emaarco/embedded-pull-delivery-never-re-delivers-a-servi branch from 4794924 to a53001d Compare November 26, 2026 13:20
@emaarco
emaarco merged commit 4c25aef into develop Nov 26, 2026
2 checks passed
@emaarco
emaarco deleted the emaarco/embedded-pull-delivery-never-re-delivers-a-servi branch November 26, 2026 13:39
@emaarco emaarco added this to the 2026.11.2 milestone Nov 26, 2026
@emaarco emaarco added the Type: bug Something isn't working label Nov 26, 2026
@emaarco emaarco removed this from the 2026.11.2 milestone Nov 26, 2026
@emaarco emaarco removed the Type: bug Something isn't working label Nov 26, 2026
@emaarco emaarco added this to the 2026.11.2 milestone Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant