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

[AppConfig] Add lock to SyncTokenPolicy #19395

Merged
merged 5 commits into from
Jun 23, 2021

Conversation

seankane-msft
Copy link
Member

Closes #19374

creating async policy, adding lock around sync token portion

@seankane-msft seankane-msft added the App Configuration Azure.ApplicationModel.Configuration label Jun 22, 2021
@seankane-msft seankane-msft requested a review from xiangyan99 June 22, 2021 20:16
@seankane-msft seankane-msft self-assigned this Jun 22, 2021
sync_token = SyncToken.from_sync_token_string(raw_token)
self._update_sync_token(sync_token)

def _update_sync_token(self, sync_token):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use lock in this method rather than every caller need to handle the lock?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By "caller" do you mean the update_sync_token caller or something different?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean maybe it is better to have
get_lock() in update_sync_token than having it in both
add_token() & on_response()?

@seankane-msft seankane-msft requested a review from xiangyan99 June 22, 2021 22:15
self._sync_tokens[sync_token.token_id] = sync_token
return
if existing_token.sequence_number < sync_token.sequence_number:
self._sync_tokens[sync_token.token_id] = sync_token
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is "add_token"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add_token is update_sync_token

@seankane-msft seankane-msft merged commit 162c31b into Azure:main Jun 23, 2021
@seankane-msft seankane-msft deleted the appconfig-lock branch June 23, 2021 13:51
iscai-msft added a commit to iscai-msft/azure-sdk-for-python that referenced this pull request Jun 24, 2021
…into get_testserver_working

* 'main' of https://github.com/Azure/azure-sdk-for-python: (45 commits)
  ignore coretestserver readme (Azure#19436)
  Add Ubuntu 20 to local dns bypass template (Azure#19432)
  Sync eng/common directory with azure-sdk-tools for PR 1729 (Azure#19415)
  Async/BearerTokenCredentialPolicy consistently calls on_exception (Azure#19195)
  [EventHubs] Fix bug in sending stress test code and update default stress test settings (Azure#19429)
  [EventHubs] Get IoT Hub Name from Redirect Address in sample (Azure#19314)
  [textanalytics] regen on v3.1 (Azure#19193)
  Adapt EG to arm template (Azure#19262)
  [Key Vault] Extend pipeline test timeout (Azure#19404)
  Update platform matrix to ubuntu 20 (Azure#19296)
  [AppConfig] Add lock to SyncTokenPolicy (Azure#19395)
  Regenerate monitor code (Azure#19375)
  Increment version for keyvault releases (Azure#19402)
  Aggregation should be a list (Azure#19381)
  [azure-mgmt-monitor] skip test to unblock ci (Azure#19390)
  Cloud event should parse smaller ms precisions (Azure#19259)
  Update release date (Azure#19399)
  [Communication]: use x-ms-date for hmac (Azure#19396)
  [Key Vault] Performance tests for certificates, keys, and secrets (Azure#19002)
  Deprecate azure-monitor (Azure#19384)
  ...
azure-sdk pushed a commit to azure-sdk/azure-sdk-for-python that referenced this pull request Jul 11, 2022
[Hub Generated] Review request for Microsoft.KeyVault to add version stable/2022-07-01 (Azure#19395)

* Adds base for updating Microsoft.KeyVault from version preview/2021-11-01-preview to version 2022-07-01

* Updates readme

* Updates API version in new specs and examples

* Merges changes from 2021-10-01 into 2022-07-01.

Changes that were merged include:
- Adding "object" type.
- Fixing description of enableRbacAuthorization (no longer a preview feature).

* Addresses the LRO_RESPONSE_HEADER guideline.

This commit ensures the following invariant in managedHsm.json:
```
If an operation can return a 202 Accepted response, then we insert
'"x-ms-long-running-operation": true,' directly below the operationId,
and we insert a Location header in the operation as well as the
corresponding example.
```

* Add check name availability api and security domain status property to managed hsm specificiation

Co-authored-by: Neeraja Akula <neerajaakula@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App Configuration Azure.ApplicationModel.Configuration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[AppConfig] Lock sync token policy when updating the sync token
2 participants