App Configuration Provider - Bug Fixes#47922
Open
mrm9084 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR delivers a set of targeted bug fixes to the azure-appconfiguration-provider data-plane package, improving auto-failover replica handling and thread safety. It distinguishes a DNS SRV lookup timeout from an empty replica result, cleans up replica clients that are no longer part of the failover set, and guards additional mapping operations with the update lock.
Changes:
- DNS discovery now raises
TimeoutErroron SRV lookup timeout (instead of returningNonefor both timeout and empty results), andrefresh_clientscatches it to apply the longer fallback refresh interval; an empty replica list now refreshes at the normal interval. refresh_clients(sync + async) now closes replica clients whose endpoints are no longer in the failover set, preventing a resource leak; the original client is always retained.__iter__,__len__, and__contains__are now guarded byself._update_lock, consistent with__getitem__/keys()/items().- Test doubles gain
close()/asyncclose()methods so refresh-driven cleanup runs cleanly.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
azure/appconfiguration/provider/_discovery.py |
Raise TimeoutError on SRV timeout rather than returning None. |
azure/appconfiguration/provider/aio/_async_discovery.py |
Async equivalent of the timeout-vs-empty distinction. |
azure/appconfiguration/provider/_client_manager.py |
Catch TimeoutError for fallback interval; close stale replica clients. |
azure/appconfiguration/provider/aio/_async_client_manager.py |
Async equivalent of timeout handling and stale-client await close(). |
azure/appconfiguration/provider/_azureappconfigurationproviderbase.py |
Guard __iter__/__len__/__contains__ with the update lock. |
tests/test_configuration_client_manager.py |
Add close() to mock client. |
tests/test_configuration_client_manager_load_balance.py |
Add close() to mock client. |
tests/aio/test_configuration_async_client_manager.py |
Add async close() to mock client. |
tests/aio/test_configuration_async_client_manager_load_balance.py |
Add async close() to mock client. |
CHANGELOG.md |
Document the three bug fixes under 2.5.1 (Unreleased). |
Comment on lines
+43
to
+44
| if replicas is None: | ||
| raise TimeoutError("Timed out while resolving auto-failover replica endpoints.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
TimeoutErrorwhen timed out, previously there was no difference between timing out and no endpoints being found.closemocks on tests for clean test results.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines