Skip to content

App Configuration Provider - Bug Fixes#47922

Open
mrm9084 wants to merge 2 commits into
Azure:mainfrom
mrm9084:small-bug-fixes
Open

App Configuration Provider - Bug Fixes#47922
mrm9084 wants to merge 2 commits into
Azure:mainfrom
mrm9084:small-bug-fixes

Conversation

@mrm9084

@mrm9084 mrm9084 commented Jul 7, 2026

Copy link
Copy Markdown
Member

Description

  • Added missing locks in iter, len, and contains.
  • DNS discover now throws a TimeoutError when timed out, previously there was no difference between timing out and no endpoints being found.
  • When endpoints are found via DNS, old ones are removed (i.e. replicas were deleted)
  • Added missing close mocks on tests for clean test results.

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.

Copilot AI review requested due to automatic review settings July 7, 2026 22:38
@github-actions github-actions Bot added the App Configuration Azure.ApplicationModel.Configuration label Jul 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 TimeoutError on SRV lookup timeout (instead of returning None for both timeout and empty results), and refresh_clients catches 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 by self._update_lock, consistent with __getitem__/keys()/items().
  • Test doubles gain close()/async close() 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.")
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.

2 participants