Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keyvault client: fix concurrent write/read to keyvault cache #28330

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wuxu92
Copy link
Contributor

@wuxu92 wuxu92 commented Dec 18, 2024

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

The keysmith locker and lock locker map cannot ensure that all operations on the cache map are properly locked. In Go's standard map structure, you cannot lock a specific key and operate on it separately; the entire map must be locked. This PR removes the lock map, as the provider runs in client mode and does not require high concurrency. Therefore, a global lock is sufficient for performance (and we use RWLocker to mitigate the impact).

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)

The failed cases are not related to this change:

image

--- PASS: TestAccKeyVault_softDeleteRecoveryDisabled (270.31s)
--- PASS: TestAccKeyVault_purgeProtectionAndSoftDeleteEnabled (302.57s)
--- PASS: TestAccKeyVault_purgeProtectionEnabled (361.52s)
--- PASS: TestAccKeyVault_purgeProtectionAttemptToDisable (389.47s)
--- FAIL: TestAccKeyVault_accessPolicyUpperLimit (444.21s)
--- PASS: TestAccKeyVault_publicNetworkAccessDisabled (798.33s)
--- PASS: TestAccKeyVault_complete (856.00s)
--- PASS: TestAccKeyVault_basic (868.80s)
--- FAIL: TestAccKeyVault_networkAclsAllowed (923.57s)
--- FAIL: TestAccKeyVault_disappears (927.44s)
--- FAIL: TestAccKeyVault_purgeProtectionViaUpdate (951.40s)
--- FAIL: TestAccKeyVault_update (954.70s)
--- PASS: TestAccKeyVault_upgradeSKU (964.68s)
--- PASS: TestAccKeyVault_softDelete (1034.14s)
--- PASS: TestAccKeyVault_networkAcls (1102.14s)
--- PASS: TestAccKeyVault_justCert (835.60s)
--- FAIL: TestAccKeyVault_requiresImport (1267.50s)
--- PASS: TestAccKeyVault_softDeleteRecovery (1036.02s)

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Related Issue(s)

Fixes #28274

@wuxu92 wuxu92 marked this pull request as ready for review December 18, 2024 04:43
@wuxu92 wuxu92 requested a review from a team as a code owner December 18, 2024 04:43
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.

fatal error: concurrent map read and map write (succeeded on retrying apply)
1 participant