Repository navigation
Conversation
…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
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.
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:
Cache eviction is moved before database deletion in removeDeployment, eliminating the window where stale cache entries exist without backing database records.
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: