Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
cf2b3c9
Extract HTTP/2 PING keepalive from PR #48420
jeet1995 May 7, 2026
60767fb
Remove IHttpClientInterceptor plumbing, add PING concurrency guard + …
jeet1995 May 12, 2026
6b651c6
Align PING timing with Rust SDK: interval=1s, timeout=2s, close on ti…
jeet1995 May 12, 2026
7bda393
Add PING interval and timeout tests, remove thin client dependency
jeet1995 May 12, 2026
ea8b379
Force single-connection H2 pool in tests for deterministic channel as…
jeet1995 May 12, 2026
eac6e9f
Add Cosmos_Live_Test_Http2NetworkFault CI stage, delete unused Http2P…
jeet1995 May 12, 2026
db82277
Add consecutive failure threshold for defensive PING-based connection…
jeet1995 May 12, 2026
43423fe
Align failure threshold with Rust SDK (5), test overrides to 2 for speed
jeet1995 May 12, 2026
75cb994
Remove spec doc — design decisions documented in PR description
jeet1995 May 12, 2026
331d989
Add sudo detection for CI VMs, PreSteps for iptables installation
jeet1995 May 12, 2026
776d46a
Log levels: WARN only for connection close, INFO for retries and send…
jeet1995 May 12, 2026
9e81699
Remove unnecessary isDebugEnabled guards — SLF4J parameterized loggin…
jeet1995 May 12, 2026
22cdad5
Single INFO log for connection close, everything else DEBUG
jeet1995 May 12, 2026
5ac7bb7
Use Http2ConnectionConfig API for pool size, replace em dashes with --
jeet1995 May 12, 2026
2d23a2b
Fix readAllBytes() compile error -- use BufferedReader for JDK 8 compat
jeet1995 May 12, 2026
36d940e
Deep review cleanup: remove unused Http2ConnectionConfig import, repl…
jeet1995 May 12, 2026
f77cdf5
Replace global counters with channel attribute for handler ref, asser…
jeet1995 May 12, 2026
50c773c
Add CHANGELOG entry for HTTP/2 PING keepalive
jeet1995 May 12, 2026
15b1ed2
Simplify CHANGELOG wording
jeet1995 May 12, 2026
6e76b9f
Remove unused PING_HANDLER_REF attribute and getFrom() method
jeet1995 May 12, 2026
5760aa6
Address Copilot review comments
jeet1995 May 13, 2026
74b33ef
Address xinlian12 review comments (4-8)
jeet1995 May 13, 2026
face9d2
Remove test 1 (pingFramesSentAtConfiguredInterval) -- does not prove …
jeet1995 May 13, 2026
7e04d21
Address review round 2: remove dead code, track lastReadNanos, bounds…
jeet1995 May 14, 2026
957be47
Add HTTP/2 PING resilience: probe PING and client-level kill switch
jeet1995 May 25, 2026
133b424
Self-review: move http2CfgAccessor to static field, remove write() ov…
jeet1995 May 25, 2026
1ac4586
Remove probe PING, remove active-streams check, revert channelInactiv…
jeet1995 May 25, 2026
2686a5a
Use lazy init pattern for http2CfgAccessor
jeet1995 May 25, 2026
f70bb19
Fix parent channel resolution and customHeaderCleaner duplicate guard
jeet1995 May 27, 2026
f1b4235
Remove PROTOCOL_ERROR logic and client-level kill switch
jeet1995 May 27, 2026
9937d96
Merge remote-tracking branch 'upstream/main' into squad/http2-ping-ke…
jeet1995 Jun 2, 2026
2bc3094
Add late-bound BooleanSupplier gate for HTTP/2 PING handler installation
jeet1995 Jun 2, 2026
2cb787d
Permanently disable HTTP/2 PING handler on SharedGatewayHttpClient
jeet1995 Jun 2, 2026
c8c41ca
Expose hasThinClientReadLocations as a live AtomicBoolean reference
jeet1995 Jun 2, 2026
349627a
Reserve UserAgentFeatureFlags bit 6 for Http2PingHealth
jeet1995 Jun 2, 2026
a1d0327
Scope HTTP/2 PING health check to thin-client-enabled clients
jeet1995 Jun 2, 2026
a93132a
Update CHANGELOG entry for HTTP/2 PING health check scoping
jeet1995 Jun 2, 2026
8277c61
Update Http2PingKeepaliveTest for thin-client scoping
jeet1995 Jun 2, 2026
ae03446
Scope Http2NetworkFault CI stage to thin-client test account
jeet1995 Jun 2, 2026
ab8260b
Tighten CHANGELOG entry for HTTP/2 PING keepalive
jeet1995 Jun 2, 2026
493838f
Re-check PING scope per tick in Http2PingHandler
jeet1995 Jun 3, 2026
05300f2
Address PR review feedback: ACK payload match, dormant scope-off, JSO…
jeet1995 Jun 3, 2026
d78e722
Merge remote-tracking branch 'upstream/main' into squad/http2-ping-ke…
jeet1995 Jun 4, 2026
400fa0c
Merge remote-tracking branch 'upstream/main' into squad/http2-ping-ke…
jeet1995 Jun 4, 2026
d33d311
Remove HTTP/2 PING thin-client scoping
jeet1995 Jun 4, 2026
953191c
Address PR review: late-ACK guard, execCommand failure, doc refresh
jeet1995 Jun 4, 2026
1661b29
Refactor Http2PingKeepaliveTest for two-pipeline runs (thin-client + …
jeet1995 Jun 4, 2026
a10f927
Add Compute matrix entry for Http2NetworkFault stage
jeet1995 Jun 4, 2026
59220ec
Merge remote-tracking branch 'upstream/main' into squad/http2-ping-ke…
jeet1995 Jun 4, 2026
c1cc39a
Consolidate HTTP/2 PING install gating into single helper
jeet1995 Jun 4, 2026
004d2fa
Use full Netty channel toString in Http2PingHandler log lines
jeet1995 Jun 4, 2026
c7dc195
Address xinlian12 review: env-var fallback, dormant state-clear, doOn…
jeet1995 Jun 4, 2026
5aaf3e8
test(cosmos): unit tests for Http2PingHandler kill-switch clear and c…
jeet1995 Jun 4, 2026
1835b55
ci(cosmos): scope HTTP/2 PING flags per profile, fix Compute matrix leg
jeet1995 Jun 5, 2026
b4342ca
Merge remote-tracking branch 'upstream/main' into squad/http2-ping-ke…
jeet1995 Jun 5, 2026
b74b116
fix(cosmos): count PING write failures toward close threshold
jeet1995 Jun 5, 2026
3266c1f
fix(cosmos-tests): close throw-away CosmosAsyncClient created by Test…
jeet1995 Jun 5, 2026
9c9c782
fix(cosmos-tests): drain TestUtils dummy clients from leak detector
jeet1995 Jun 5, 2026
d2d14e5
fix(cosmos-tests): isolate dummy client cleanup to GatewayReadConsist…
jeet1995 Jun 5, 2026
e19c187
Isolate dummy-client leak fix to GatewayReadConsistencyStrategySpyWir…
jeet1995 Jun 5, 2026
c612015
Address xinlian12 PR comments: TOCTOU guard, doc clarity, ACK-timeout…
jeet1995 Jun 5, 2026
5b70c7c
Merge remote-tracking branch 'upstream/main' into squad/http2-ping-ke…
jeet1995 Jun 5, 2026
17db071
docs(cosmos): clarify HTTP/2 PING threshold semantics and expand CHAN…
jeet1995 Jun 5, 2026
7f4b509
H3: route HTTP/2 PING-driven channel close as retryable transport fai…
jeet1995 Jun 5, 2026
0de4921
H3: align doc/comment/CHANGELOG wording with PING-send-failure close …
jeet1995 Jun 5, 2026
9e4b1e7
test(cosmos): account for Http2PingHealth feature flag in user-agent …
jeet1995 Jun 5, 2026
3d10f06
fix(cosmos): address xinlian12 PR review on retry comment + PING gett…
jeet1995 Jun 5, 2026
5020ee1
Update CHANGELOG.md
jeet1995 Jun 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions sdk/cosmos/azure-cosmos-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,67 @@ Licensed under the MIT License.
</plugins>
</build>
</profile>
<profile>
<id>manual-http-network-fault</id>
<properties>
<test.groups>manual-http-network-fault</test.groups>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-failsafe-plugin;external_dependency} -->
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/manual-http-network-fault-testng.xml</suiteXmlFile>
</suiteXmlFiles>
<systemPropertyVariables>
<COSMOS.CLIENT_LEAK_DETECTION_ENABLED>true</COSMOS.CLIENT_LEAK_DETECTION_ENABLED>
<COSMOS.THINCLIENT_ENABLED>true</COSMOS.THINCLIENT_ENABLED>
<COSMOS.HTTP2_ENABLED>true</COSMOS.HTTP2_ENABLED>
<COSMOS.HTTP2_PING_HEALTH_ENABLED>true</COSMOS.HTTP2_PING_HEALTH_ENABLED>
<COSMOS.HTTP2_PING_INTERVAL_IN_SECONDS>1</COSMOS.HTTP2_PING_INTERVAL_IN_SECONDS>
<COSMOS.HTTP2_PING_TIMEOUT_IN_SECONDS>2</COSMOS.HTTP2_PING_TIMEOUT_IN_SECONDS>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- Compute / Gateway V2 variant of manual-http-network-fault. Same suite XML and test
group as the thin-client variant; the only difference is COSMOS.THINCLIENT_ENABLED=false
so HTTP/2 tests (e.g. Http2PingKeepaliveTest) exercise the regional gateway on :443
instead of the thin-client proxy on :10250. Requires an account whose regional
gateway negotiates h2 via ALPN. -->
<id>manual-http-network-fault-compute</id>
<properties>
<test.groups>manual-http-network-fault</test.groups>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-failsafe-plugin;external_dependency} -->
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/manual-http-network-fault-testng.xml</suiteXmlFile>
</suiteXmlFiles>
<systemPropertyVariables>
<COSMOS.CLIENT_LEAK_DETECTION_ENABLED>true</COSMOS.CLIENT_LEAK_DETECTION_ENABLED>
<COSMOS.THINCLIENT_ENABLED>false</COSMOS.THINCLIENT_ENABLED>
<COSMOS.HTTP2_ENABLED>true</COSMOS.HTTP2_ENABLED>
<COSMOS.HTTP2_PING_HEALTH_ENABLED>true</COSMOS.HTTP2_PING_HEALTH_ENABLED>
<COSMOS.HTTP2_PING_INTERVAL_IN_SECONDS>1</COSMOS.HTTP2_PING_INTERVAL_IN_SECONDS>
<COSMOS.HTTP2_PING_TIMEOUT_IN_SECONDS>2</COSMOS.HTTP2_PING_TIMEOUT_IN_SECONDS>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- thin client integration tests, requires thin client endpoint and key -->
<id>fi-thinclient-multi-region</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.azure.cosmos.implementation.RxStoreModel;
import com.azure.cosmos.implementation.TestConfigurations;
import com.azure.cosmos.implementation.UserAgentContainer;
import com.azure.cosmos.implementation.UserAgentFeatureFlags;
import com.azure.cosmos.implementation.Utils;
import com.azure.cosmos.implementation.clienttelemetry.ClientTelemetry;
import com.azure.cosmos.implementation.directconnectivity.GatewayAddressCache;
Expand Down Expand Up @@ -1978,8 +1979,17 @@ private void validateChannelAcquisitionContext(CosmosDiagnostics diagnostics, bo
}

private String generateHttp2OptedInUserAgentIfRequired(String userAgent) {
// Mirrors RxDocumentClientImpl.addUserAgentSuffix + UserAgentContainer.setFeatureEnabledFlagsAsSuffix:
// when HTTP/2 is enabled, the Http2 bit is set; when PING keepalive is also effectively enabled
// (kill-switch on AND positive interval), the Http2PingHealth bit is OR'd in.
// Tests here do not override Http2ConnectionConfig.setEnabled(...) so the per-client override branch
// in addUserAgentSuffix is a no-op for this helper.
if (Configs.isHttp2Enabled()) {
userAgent = userAgent + "|F10";
int featureValue = UserAgentFeatureFlags.Http2.getValue();
if (Configs.isHttp2PingHealthEnabled() && Configs.getHttp2PingIntervalInSeconds() > 0) {
featureValue |= UserAgentFeatureFlags.Http2PingHealth.getValue();
}
userAgent = userAgent + "|F" + Integer.toHexString(featureValue).toUpperCase(Locale.ROOT);
}

return userAgent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package com.azure.cosmos;

import com.azure.cosmos.implementation.Configs;
import com.azure.cosmos.implementation.UserAgentFeatureFlags;
import com.azure.cosmos.models.CosmosContainerResponse;
import com.azure.cosmos.rx.TestSuiteBase;
import org.testng.ITestContext;
Expand All @@ -15,6 +16,8 @@
import org.testng.annotations.Factory;
import org.testng.annotations.Test;

import java.util.Locale;

import static org.assertj.core.api.Assertions.assertThat;

public class UserAgentSuffixTest extends TestSuiteBase {
Expand Down Expand Up @@ -115,8 +118,15 @@ public void userAgentSuffixWithWhitespaceAndAsciiSpecialChars() {

private void validateUserAgentSuffix(String actualUserAgent, String expectedUserAgentSuffix) {

// Mirrors RxDocumentClientImpl.addUserAgentSuffix + UserAgentContainer.setFeatureEnabledFlagsAsSuffix:
// when HTTP/2 is enabled, the Http2 bit is set; when PING keepalive is also effectively enabled
// (kill-switch on AND positive interval), the Http2PingHealth bit is OR'd in.
if (Configs.isHttp2Enabled()) {
expectedUserAgentSuffix = expectedUserAgentSuffix + "|F10";
int featureValue = UserAgentFeatureFlags.Http2.getValue();
if (Configs.isHttp2PingHealthEnabled() && Configs.getHttp2PingIntervalInSeconds() > 0) {
featureValue |= UserAgentFeatureFlags.Http2PingHealth.getValue();
}
expectedUserAgentSuffix = expectedUserAgentSuffix + "|F" + Integer.toHexString(featureValue).toUpperCase(Locale.ROOT);
}

assertThat(actualUserAgent).endsWith(expectedUserAgentSuffix);
Expand Down
Loading
Loading