Skip to content

fix(c7-embedded, c7-remote): tasks not delivered when workerLockDurationInMilliseconds restriction is set #167

@emaarco

Description

@emaarco

When the adapter polls for external service tasks, it matches each locked task against registered subscriptions. This matching checks task properties like topic name, but also evaluates all restrictions defined on the subscription. With process-engine-worker 0.8.0 we introduced the workerLockDurationInMilliseconds restriction to allow configuring a custom lock timeout per subscription — but we did not add a corresponding case to the matches() method in either adapter variant. As a result, any subscription that uses this restriction hits the else -> false branch and is never matched, so its tasks are never delivered.

Steps to reproduce

  • Library version: current main, process-engine-worker >= 0.8.0
  • JDK version: 17+
  • Operating system: any
  • Steps:
    1. Register a subscription with workerLockDurationInMilliseconds set in its restrictions.
    2. The engine returns a locked task matching that subscription's topic.
    3. The task is never delivered — matches() returns false due to the unhandled restriction key.

Expected behaviour

workerLockDurationInMilliseconds is a worker-side configuration hint and should not affect task matching. A subscription with this restriction set should be matched and receive tasks normally. Additionally, the else branch should log the unrecognised restriction key at debug level so unmatched restrictions are visible during troubleshooting.

Actual behaviour

c7-embedded-coreEmbeddedPullServiceTaskDelivery.matches():

CommonRestrictions.PROCESS_DEFINITION_VERSION_TAG -> it.value == task.processDefinitionVersionTag
else -> false  // workerLockDurationInMilliseconds hits this branch — no log, no match

c7-remote-corePullServiceTaskDelivery.matches():

CommonRestrictions.PROCESS_DEFINITION_VERSION_TAG -> it.value == task.processDefinitionVersionTag
else -> false  // workerLockDurationInMilliseconds hits this branch — no log, no match

Note: both variants already handle workerLockDurationInMilliseconds correctly in their getLockDurationForSubscription() helper — the fix is only needed in matches().

Metadata

Metadata

Assignees

Labels

Type: bugSomething isn't working

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions