bpm: the Inbox list omits a task completed while it is being built instead of failing with 500 (#7575) - #7665
Merged
delchev merged 1 commit intoOct 5, 2026
Conversation
…stead of failing with 500 (eclipse-dirigible#7575) Cause: GET /services/inbox/tasks lists the tasks with one query and then reads each one again (identity links, process instance). A task another session completed in between failed that read - the tenant validator's "Task with id [..] not found or does not belong to current tenant", or, when it was its process's last task, a NullPointerException on the ended process instance - and the uncaught exception failed the whole list with a 500 for everyone loading it at that moment. Change: each listed task is mapped through mapListedTask. A per-task read that throws is followed by one tenant-scoped existence query (new isTaskActive on BpmProviderFlowable / BpmService); a task confirmed gone is omitted and logged at DEBUG, while a failure on a task that still exists propagates as before. Applies to both list endpoints (/tasks and /instance/{id}/tasks). Verified: BpmInboxEndpointVanishedTaskTest (new: both race outcomes, the propagate control, the instance listing) and the module suite (56); BpmInboxConcurrentCompletionIT (new: lists continuously while 40 tasks are completed tail-first) - 11 of 36 list calls answered 500 against the unfixed endpoint, all 200 with the fix; BpmTaskLabelKeyIT and IntentWorkflowStatusIT green on H2; formatter:validate with the cache wiped; release-profile javadoc build of the module. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cause
GET /services/inbox/tasks(and/instance/{id}/tasks) lists the tasks with one query and then reads each one again: its identity links, then its process instance. If another session completes a task in between, that read fails in one of two ways:Task with id [..] not found or does not belong to current tenant(the issue's trace).mapProcessInstancethrows aNullPointerException.Neither exception was caught, so one vanished task failed the whole list with a 500 for everyone loading it at that moment.
Change
This takes the issue's primary option: a task that vanished between the query and its per-task read is treated as gone and omitted.
mapListedTask. If a per-task read throws, one tenant-scoped existence query decides what happens. That query is the newisTaskActive(taskId)onBpmProviderFlowable/BpmService, acount()mirroringgetTaskActions.Taskcarries no business key or definition name, so it would mean a new batched process-instance query. That is a larger change than this defect needs.Verification
BpmInboxEndpointVanishedTaskTest: covers the "not found" read, the ended-process NPE, a failure on a still-active task that must still propagate, and the per-instance listing. The existingBpmInboxEndpointSubjectTestand the module suite (56) pass.BpmInboxConcurrentCompletionIT(HTTP-only): it starts 40 single-task processes, then lists the group Inbox continuously while completing the tasks tail-first, and requires every list call to answer 200. Tail-first is deliberate, because each list query then still holds the tasks being completed while the lister walks toward them.BpmTaskLabelKeyITandIntentWorkflowStatusITpass on H2.mvn formatter:validatepasses after wiping the formatter cache. The release-profile javadoc build ofengine-bpm-flowablepasses.Not verified: the PostgreSQL leg.
Fixes #7575
🤖 Generated with Claude Code