Skip to content

Fix race condition when caching vault token - #62195

Merged
Ch3LL merged 1 commit into
saltstack:masterfrom
dwoz:issue/master/59361
Jun 21, 2022
Merged

Ch3LL merged 1 commit into
saltstack:masterfrom
dwoz:issue/master/59361

Conversation

@dwoz

@dwoz dwoz commented Jun 21, 2022

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Fixes race condition while caching vault token which can lead to a corrupted json string.
  • Migrate salt.utils.vault unit tests to pytest

What issues does this PR fix or reference?

Fixes: #59361

Previous Behavior

If two threads or processes try to cache a vault token at the same time it could become corrupted.

New Behavior

Uses an atomic operation when caching vault token to ensure no race condition will happen.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

@dwoz dwoz added the Phosphorus v3005.0 Release code name and version label Jun 21, 2022
@dwoz
dwoz requested a review from a team as a code owner June 21, 2022 00:39
@dwoz
dwoz requested review from whytewolf and removed request for a team June 21, 2022 00:39
@dwoz
dwoz force-pushed the issue/master/59361 branch from 335700e to 4d54b5a Compare June 21, 2022 07:08
@dwoz
dwoz force-pushed the issue/master/59361 branch from 4d54b5a to c064bd1 Compare June 21, 2022 07:37
@Ch3LL
Ch3LL merged commit 065ef08 into saltstack:master Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Phosphorus v3005.0 Release code name and version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Corrupted /var/cache/salt/master/salt_vault_token

3 participants