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

[Key Vault] Remove direct uses of asyncio.sleep #33819

Merged
merged 4 commits into from Jan 23, 2024
Merged

Conversation

mccoyp
Copy link
Member

@mccoyp mccoyp commented Jan 12, 2024

Description

Resolves #33748. Key Vault uses a handful of custom polling methods, which currently use asyncio.sleep directly. This PR refactors them to instead use the client transport's own sleep method. Polling methods now accept an operation's original pipeline response as a parameter and use its pipeline context.

asyncio is still imported and used directly in tests and samples; a separate PR will follow this one to remove test instances (to keep this PR as simple as possible).

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@mccoyp mccoyp added KeyVault Client This issue points to a problem in the data-plane of the library. labels Jan 12, 2024
@mccoyp
Copy link
Member Author

mccoyp commented Jan 12, 2024

/azp run python - keyvault - tests

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@mccoyp mccoyp force-pushed the kv-asyncio branch 2 times, most recently from 6076733 to f97ef3a Compare January 13, 2024 01:04
@mccoyp
Copy link
Member Author

mccoyp commented Jan 13, 2024

/azp run python - keyvault - tests

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mccoyp mccoyp marked this pull request as ready for review January 16, 2024 19:03
@mccoyp mccoyp requested a review from schaabs as a code owner January 16, 2024 19:03
@mccoyp
Copy link
Member Author

mccoyp commented Jan 17, 2024

/azp run python - keyvault - tests

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@kristapratico kristapratico left a comment

Choose a reason for hiding this comment

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

LGTM. Add the fix to the changelog?

@mccoyp mccoyp merged commit 0f9eb9c into Azure:main Jan 23, 2024
16 checks passed
@mccoyp mccoyp deleted the kv-asyncio branch January 23, 2024 01:33
sofiar-msft pushed a commit to sofiar-msft/azure-sdk-for-python that referenced this pull request Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. KeyVault
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

KV must not use "asyncio.sleep" directly
3 participants