Fix partitionLevelCircuitBreakerCfg missing from CosmosDiagnostics clientCfgs#49734
Merged
jeet1995 merged 9 commits intoJul 7, 2026
Merged
Conversation
…ientCfgs The partitionLevelCircuitBreakerCfg field disappeared from the clientCfgs section of CosmosDiagnostics when a customer explicitly enabled Per-Partition Circuit Breaker (PPCB) client-side. Root cause: the diagnostics write was coupled to the Per-Partition Automatic Failover (PPAF) initialization path, so the field was only populated when the service mandated PPAF, not when PPCB was configured client-side. Fix: move the diagnostics write into initializePerPartitionCircuitBreaker(), which is invoked unconditionally at client init, so the field appears whenever the circuit breaker is configured client-side. Adds a CI-runnable regression test asserting all clientCfgs keys are present, including partitionLevelCircuitBreakerCfg. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restores partitionLevelCircuitBreakerCfg in CosmosDiagnostics client configuration output when Per-Partition Circuit Breaker (PPCB) is enabled client-side, by decoupling the diagnostics write from the Per-Partition Automatic Failover (PPAF) initialization path.
Changes:
- Move
partitionLevelCircuitBreakerCfgpopulation intoinitializePerPartitionCircuitBreaker()so it is set during normal client initialization. - Add a unit regression test that enables PPCB via system property, serializes the diagnostics client config, and asserts expected
clientCfgskeys (includingpartitionLevelCircuitBreakerCfg) and value.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java | Relocates diagnostics population for PPCB config into the circuit breaker init path. |
| sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/RxDocumentClientImplTest.java | Adds a unit regression test validating diagnostics serialization includes partitionLevelCircuitBreakerCfg when PPCB is enabled. |
…iagnostics-clientcfg # Conflicts: # sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/RxDocumentClientImplTest.java
…roperty Remove trailing comma before closing brace in the COSMOS.PARTITION_LEVEL_CIRCUIT_BREAKER_CONFIG JSON so the value is strictly valid and clearer as a customer reference. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…kerE2ETests Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… keys The partitionLevelCircuitBreakerCfg field now appears in clientCfgs for every client regardless of PPCB configuration, so the E2E test no longer sets the COSMOS.PARTITION_LEVEL_CIRCUIT_BREAKER_CONFIG system property. It just builds a plain client and asserts all expected clientCfgs keys (including partitionLevelCircuitBreakerCfg) are present in CosmosDiagnostics. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove PPCB System.setProperty/clearProperty and the value-specific assertion; assert only that all clientCfgs keys are present, matching the E2E test simplification. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…iagnostics-clientcfg # Conflicts: # sdk/cosmos/azure-cosmos/CHANGELOG.md
Member
Author
|
/azp run java - cosmos - tests |
Member
Author
|
/azp run java - cosmos - spark |
Member
Author
|
/azp run java - cosmos - kafka |
|
Azure Pipelines successfully started running 1 pipeline(s). |
2 similar comments
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jeet1995
added a commit
to jeet1995/azure-sdk-for-java
that referenced
this pull request
Jul 9, 2026
Catches PR Azure#49725 up with PR Azure#49437. Resolved duplicate PPCB diagnostics fix (both branches added it independently; kept probe-flow/Azure#49734 canonical form for the comment and the regression test). Preserved kusto-sink's unique eager HTTP/2 pre-warm and Kusto/ADX benchmark sink work. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Problem
The
partitionLevelCircuitBreakerCfgfield disappeared from theclientCfgssection ofCosmosDiagnosticswhen a customer explicitly enabled Per-Partition Circuit Breaker (PPCB) client-side. Customers who previously relied on seeing this diagnostic entry (e.g."partitionLevelCircuitBreakerCfg": "(cb: true, type: CONSECUTIVE_EXCEPTION_COUNT_BASED, rexcntt: 10, wexcntt: 5)") no longer saw it.Root cause
The diagnostics write for the circuit breaker config was coupled to the Per-Partition Automatic Failover (PPAF) initialization path (
initializePerPartitionFailover). As a result, the field was only populated when the service mandated PPAF — not when PPCB was configured client-side.Fix
Move the diagnostics write into
initializePerPartitionCircuitBreaker(), which is invoked unconditionally at client init. This ensures thepartitionLevelCircuitBreakerCfgfield appears inCosmosDiagnosticsfor every client build, independent of the PPAF path.Tests
Both tests assert that all expected
clientCfgskeys are present (includingpartitionLevelCircuitBreakerCfg) without setting any PPCB configuration, since the field must now be emitted for every client regardless of PPCB config. They fail without the fix and pass with it.unitgroup):RxDocumentClientImplTest#diagnosticsClientConfigContainsAllClientCfgKeysIncludingPartitionLevelCircuitBreakerbuilds a client, serializes the diagnostics client config, and asserts everyclientCfgskey is present.PerPartitionCircuitBreakerE2ETests#partitionLevelCircuitBreakerConfigIsPresentInClientCfgsDiagnosticsissues an operation, extractsclientCfgsfrom the resultingCosmosDiagnostics, and asserts every expected key is present against a live-style client.Verification
azure-cosmosrebuilt successfully.Tests run: 1, Failures: 0, Errors: 0.