Skip to content

InMemory store should only return deep copies.#17061

Merged
ettec merged 4 commits intodevelopfrom
engine-race-condition-fix
Apr 1, 2025
Merged

InMemory store should only return deep copies.#17061
ettec merged 4 commits intodevelopfrom
engine-race-condition-fix

Conversation

@ettec
Copy link
Collaborator

@ettec ettec commented Apr 1, 2025

Jordans race condition tests identified a flaw in the inmemory store when compared with the DB store, in essence the DB store was deep copying the executions before returning them to the caller which prevented race condition, this PR updates the in memory store to do the same ensuring the returned objects are effectively immutable.

As an unrelated TODO we should probably modify the workflow execution type to make it clear that it is effectively immutable to prevent any unexpected side effects from new code attempting to modify the state of a workflowexecution object outside of the store - captured here-> https://smartcontract-it.atlassian.net/browse/CAPPL-682

@ettec ettec changed the title deep copy executions before returning from store to ensure the execut… InMemory store should only return deep copies. Apr 1, 2025
@ettec ettec marked this pull request as ready for review April 1, 2025 11:12
@ettec ettec requested a review from a team as a code owner April 1, 2025 11:12
@cl-sonarqube-production
Copy link

@ettec ettec added this pull request to the merge queue Apr 1, 2025
Merged via the queue into develop with commit 02657ff Apr 1, 2025
191 of 192 checks passed
@ettec ettec deleted the engine-race-condition-fix branch April 1, 2025 13:52
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.

3 participants