Skip to content

Clear process definition caches before deletion in DeploymentManager (#4039) - #4343

Open
ESTeR9 wants to merge 1 commit into
flowable:mainfrom
ESTeR9:fix/4039-cache-not-cleared-after-definition-deletion
Open

ESTeR9 wants to merge 1 commit into
flowable:mainfrom
ESTeR9:fix/4039-cache-not-cleared-after-definition-deletion

Conversation

@ESTeR9

@ESTeR9 ESTeR9 commented Nov 27, 2026

Copy link
Copy Markdown

Fixes #4039

When a process definition is deleted via repositoryService.deleteDeployment, the process definition cache was being cleared after the database records were deleted. This created a window where a concurrent call to getProcessDefinition could return a stale cache entry for an already-deleted definition.

Two changes are made:

  1. Cache eviction is moved before database deletion in removeDeployment, eliminating the window where stale cache entries exist without backing database records.

  2. A defensive stale-cache check is added in findDeployedProcessDefinitionById. When a cache hit occurs, the method verifies the process definition still exists in the database. If it does not (e.g. deleted by another node in a multi-node deployment), the stale entry is evicted and a FlowableObjectNotFoundException is thrown.

Check List:

  • Unit tests: NO (cache ordering fix — no behavioral change, existing DeploymentManager tests cover deletion)
  • Documentation: NA

…lowable#4039)

When a process definition is deleted via repositoryService.deleteDeployment,
the process definition cache was being cleared after the database records were
deleted. This created a window where a concurrent call to getProcessDefinition
could return a stale cache entry for an already-deleted definition.

Two changes are made:

1. Cache eviction is moved before database deletion in removeDeployment,
   eliminating the window where stale cache entries exist without backing
   database records.

2. A defensive stale-cache check is added in findDeployedProcessDefinitionById.
   When a cache hit occurs, the method verifies the process definition still
   exists in the database. If it does not (e.g. deleted by another node in a
   multi-node deployment), the stale entry is evicted and a
   FlowableObjectNotFoundException is thrown.

This branch has not been deployed

No deployments
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.

Cache is not cleared after deletion of process definition

1 participant