Skip to content

Concurrent Health Checks - #40588

Merged
Tomas Varon (tvaron3) merged 9 commits into
Azure:mainfrom
tvaron3:tvaron3/concurrentHealthChecks
Apr 18, 2025
Merged

Tomas Varon (tvaron3) merged 9 commits into
Azure:mainfrom
tvaron3:tvaron3/concurrentHealthChecks

Conversation

@tvaron3

@tvaron3 Tomas Varon (tvaron3) commented Apr 17, 2025 •

Copy link
Copy Markdown
Member

Description

  • The health checks for the cosmosdb endpoints will now be done concurrently for the async apis. This will help with the startup time of applications. Note that the getDatabaseAccount is not done concurrently only the health checks afterwards. So an account with two regions would see the following behavior: one call to the global endpoint for the database account information and two concurrent calls to the two regional endpoints.
  • The health checks for the async apis will no longer be done only for the first two preferred regions but for all the preferred regions and the first write region.
  • Fixed bug where the write region was not checked if it was not part of the preferred regions.
  • The sync apis will still be limited to the first four successful calls.

@tvaron3
Tomas Varon (tvaron3) marked this pull request as ready for review April 17, 2025 19:48
Copilot AI review requested due to automatic review settings April 17, 2025 19:48
@tvaron3
Tomas Varon (tvaron3) requested a review from a team as a code owner April 17, 2025 19:48

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.

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

sdk/cosmos/azure-cosmos/azure/cosmos/_location_cache.py:428

  • Calling union on the 'health_check_endpoints' set does not modify the set in-place; consider using 'update' or reassigning the result to ensure that endpoints from both read and write contexts are included.
health_check_endpoints.union(_get_health_check_endpoints(

@azure-sdk

Copy link
Copy Markdown
Collaborator

API change check

API changes are not detected in this pull request.

@tvaron3

Copy link
Copy Markdown
Member Author

/azp run python - cosmos - tests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@simorenoh Simon Moreno (simorenoh) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

changes lgtm - let's just make sure the relevant failing health check tests are working as intended

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks Tomas Varon (@tvaron3)

@tvaron3
Tomas Varon (tvaron3) merged commit d71855e into Azure:main Apr 18, 2025
Rena (cRui861) pushed a commit that referenced this pull request May 14, 2025
* concurrent health checks

* update changelog

* add test, fix bug, update changelog

* fix tests

* fix tests

* fix tests

* fix tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants