Skip to content

RUMM-2150: Fix race condition in the features folders creation logic#912

Merged
0xnm merged 1 commit into
developfrom
nogorodnikov/rumm-2150/fix-race-condition-in-feature-folders-creation
Apr 27, 2022
Merged

RUMM-2150: Fix race condition in the features folders creation logic#912
0xnm merged 1 commit into
developfrom
nogorodnikov/rumm-2150/fix-race-condition-in-feature-folders-creation

Conversation

@0xnm

@0xnm 0xnm commented Apr 26, 2022

Copy link
Copy Markdown
Member

What does this PR do?

This PR fixes a race condition in the features folders creation logic. It may occur when one thread checks for the existence of the root dit for the feature, gets that folder doesn't exist and goes in the folder creation logic branch, and another thread does the same. This may lead to a situation when both threads will call File#mkdirs but only one of them will get a successful result, because another one will get a failure since folder is already created.

Not sure if this situation can happen often in the client setup, but it happens in our nightly test runs when we do a call to change a consent (so to migrate files from one dir to another) right after SDK initialization step, which impacts test outcome.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@0xnm
0xnm requested a review from a team as a code owner April 26, 2022 08:26
@0xnm
0xnm merged commit 7588259 into develop Apr 27, 2022
@0xnm
0xnm deleted the nogorodnikov/rumm-2150/fix-race-condition-in-feature-folders-creation branch April 27, 2022 09:49
@xgouchet xgouchet added this to the 1.13.0 milestone Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants