Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions sdk/cosmos/azure-cosmos/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#### Bugs Fixed
* Fixed a rare race condition for `query plan` cache exceeding the allowed size limit - See [PR 31859](https://github.com/Azure/azure-sdk-for-java/pull/31859)
* Added improvement in `RntbdClientChannelHealthChecker` for detecting continuous transit timeout. - See [PR 31544](https://github.com/Azure/azure-sdk-for-java/pull/31544)

#### Other Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public DirectConnectionConfig() {
* <p>
* The connection endpoint rediscovery feature is designed to reduce and spread-out latency spikes that may occur during maintenance operations.
*
* By default, connection endpoint rediscovery is disabled.
* By default, connection endpoint rediscovery is enabled.
*
* @return {@code true} if Direct TCP connection endpoint rediscovery is enabled; {@code false} otherwise.
*/
Expand All @@ -73,7 +73,7 @@ public boolean isConnectionEndpointRediscoveryEnabled() {
* <p>
* The connection endpoint rediscovery feature is designed to reduce and spread-out latency spikes that may occur during maintenance operations.
*
* By default, connection endpoint rediscovery is disabled.
* By default, connection endpoint rediscovery is enabled.
*
* @param connectionEndpointRediscoveryEnabled {@code true} if connection endpoint rediscovery is enabled; {@code
* false} otherwise.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@
import com.azure.cosmos.implementation.RxDocumentServiceRequest;
import com.azure.cosmos.implementation.UserAgentContainer;
import com.azure.cosmos.implementation.clienttelemetry.ClientTelemetry;
import com.azure.cosmos.implementation.directconnectivity.rntbd.RntbdEndpoint;
import com.azure.cosmos.implementation.directconnectivity.rntbd.RntbdObjectMapper;
import com.azure.cosmos.implementation.directconnectivity.rntbd.RntbdRequestArgs;
import com.azure.cosmos.implementation.directconnectivity.rntbd.RntbdRequestRecord;
import com.azure.cosmos.implementation.directconnectivity.rntbd.RntbdServiceEndpoint;
import com.azure.cosmos.implementation.directconnectivity.rntbd.*;
import com.azure.cosmos.implementation.guava25.base.Strings;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
Expand Down Expand Up @@ -474,6 +470,13 @@ public static final class Options {
@JsonProperty()
private final Duration sslHandshakeTimeoutMinDuration;

/**
* This property will be used in {@link RntbdClientChannelHealthChecker} to determine whether there is a readHang.
* If there is no successful reads for up to receiveHangDetectionTime, and the number of consecutive timeout has also reached this config,
* then SDK is going to treat the channel as unhealthy and close it.
*/
@JsonProperty()
Comment thread
xinlian12 marked this conversation as resolved.
private final int transientTimeoutDetectionThreshold;
// endregion

// region Constructors
Expand Down Expand Up @@ -508,6 +511,7 @@ private Options(final Builder builder) {
this.tcpKeepIdle = builder.tcpKeepIdle;
this.preferTcpNative = builder.preferTcpNative;
this.sslHandshakeTimeoutMinDuration = builder.sslHandshakeTimeoutMinDuration;
this.transientTimeoutDetectionThreshold = builder.transientTimeoutDetectionThreshold;

this.connectTimeout = builder.connectTimeout == null
? builder.tcpNetworkRequestTimeout
Expand Down Expand Up @@ -541,6 +545,7 @@ private Options(final ConnectionPolicy connectionPolicy) {
this.tcpKeepIntvl = 1; // Configuration for EpollChannelOption.TCP_KEEPINTVL
this.tcpKeepIdle = 30; // Configuration for EpollChannelOption.TCP_KEEPIDLE
this.sslHandshakeTimeoutMinDuration = Duration.ofSeconds(5);
this.transientTimeoutDetectionThreshold = 3;
Comment thread
xinlian12 marked this conversation as resolved.
this.preferTcpNative = true;
}

Expand Down Expand Up @@ -646,6 +651,11 @@ public long sslHandshakeTimeoutInMillis() {
return Math.max(this.sslHandshakeTimeoutMinDuration.toMillis(), this.connectTimeout.toMillis());
}

public int transientTimeoutDetectionThreshold() {
return this.transientTimeoutDetectionThreshold;
}


// endregion

// region Methods
Expand Down Expand Up @@ -706,7 +716,8 @@ public String toDiagnosticsString() {
* "requestTimerResolution": "PT100MS",
* "sendHangDetectionTime": "PT10S",
* "shutdownTimeout": "PT15S",
* "threadCount": 16
* "threadCount": 16,
* "transientTimeoutDetectionThreshold": 3
* }}</pre>
* </li>
* </ol>
Expand Down Expand Up @@ -804,6 +815,7 @@ public static class Builder {
private int tcpKeepIdle;
private boolean preferTcpNative;
private Duration sslHandshakeTimeoutMinDuration;
private int transientTimeoutDetectionThreshold;

// endregion

Expand Down Expand Up @@ -838,6 +850,7 @@ public Builder(ConnectionPolicy connectionPolicy) {
this.tcpKeepIdle = DEFAULT_OPTIONS.tcpKeepIdle;
this.preferTcpNative = DEFAULT_OPTIONS.preferTcpNative;
this.sslHandshakeTimeoutMinDuration = DEFAULT_OPTIONS.sslHandshakeTimeoutMinDuration;
this.transientTimeoutDetectionThreshold = DEFAULT_OPTIONS.transientTimeoutDetectionThreshold;
}

// endregion
Expand Down
Loading