Skip to content

fix(cib7-embedded): align failed service task delivery with the other adapters - #176

Merged
emaarco merged 1 commit into
developfrom
emaarco/align-embedded-service-task-delivery-with-the-co
Nov 26, 2026
Merged

emaarco merged 1 commit into
developfrom
emaarco/align-embedded-service-task-delivery-with-the-co

Conversation

@emaarco

@emaarco emaarco commented Nov 26, 2026

Copy link
Copy Markdown
Member

Why

When a handler threw, EmbeddedPullServiceTaskDelivery only deactivated the subscription of the task. The Camunda 7, Operaton and CIB seven remote adapters also call the termination handler with reason DELETE, so state a subscriber keeps for the task is cleaned up. The embedded delivery also computed the retries handed to the engine differently from all other adapters.

What

  • After a failed delivery, cleanupFailedDelivery deactivates the subscription and calls its termination handler with reason DELETE, within the handler's thread context class loader. An exception from the termination handler is logged as PROCESS-ENGINE-CIB7-EMBEDDED-047 and does not escape the delivery.
  • On failure, the retries passed to handleFailure are now lockedTask.retries?.minus(1) ?: retries, as in the other adapters. A task without retries now gets the configured retries on its first failure instead of one less, so a worker with retries = 3 gets four attempts instead of three.
  • EmbeddedPullServiceTaskDeliveryThreadingTest gets a failing subscription and three tests: termination with DELETE and a failed task after a handler error, the configured retries on the first failure, and decremented retries on a repeated failure.

Verification

  • Against the old delivery, the termination test and the first-failure retries test fail; with the change they pass.
  • ./mvnw -pl engine-adapter/cib-seven-embedded-core,engine-adapter/cib-seven-embedded-spring-boot-starter -am verify succeeded: 80 tests in core, 25 in the starter, all green.
  • The remote adapter was not touched.

Out of scope / Follow-ups

  • EmbeddedPullUserTaskDelivery has the same gap: a failing handler only deactivates the subscription and never triggers termination.
  • The embedded service task delivery still differs from Camunda 7 and Operaton in three places: it terminates delivered tasks only once they no longer exist in the engine (a deliberate choice in fix(cib7-embedded): do not block pull service task delivery on running tasks #139, which excludes running tasks), it does not drop tasks whose lock expired while queued, and it has no delivery metrics.

Closes #175

… adapters

Call the termination handler with reason DELETE after a failed delivery
and hand the configured retries to the engine on the first failure,
as the Camunda 7, Operaton and CIB seven remote adapters do.

Closes #175
@emaarco
emaarco merged commit e094611 into develop Nov 26, 2026
2 checks passed
@emaarco
emaarco deleted the emaarco/align-embedded-service-task-delivery-with-the-co branch November 26, 2026 13:16
@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.

Align embedded service task delivery with the contract of the other adapters

1 participant