Skip to content

Commit

Permalink
mobile: Add the ability to set the per-try idle timeout in Cronvoy
Browse files Browse the repository at this point in the history
Signed-off-by: Ali Beyad <abeyad@google.com>
  • Loading branch information
abeyad committed Jun 25, 2024
1 parent 9db40df commit 159182a
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class NativeCronvoyEngineBuilderImpl extends CronvoyEngineBuilderImpl {
private final int mH2ConnectionKeepaliveTimeoutSeconds = 10;
private final int mMaxConnectionsPerHost = 7;
private int mStreamIdleTimeoutSeconds = 15;
private final int mPerTryIdleTimeoutSeconds = 15;
private int mPerTryIdleTimeoutSeconds = 15;
private final String mAppVersion = "unspecified";
private final String mAppId = "unspecified";
private TrustChainVerification mTrustChainVerification = VERIFY_TRUST_CHAIN;
Expand Down Expand Up @@ -157,6 +157,21 @@ public NativeCronvoyEngineBuilderImpl setStreamIdleTimeoutSeconds(int timeout) {
return this;
}

/**
* Set the per-try stream idle timeout, in seconds, which is defined as the period in which
* there are no active requests. When the idle timeout is reached, the connection is closed.
* This setting is the same as the stream idle timeout, except it's applied per-retry attempt.
* See https://github.com/envoyproxy/envoy/blob/f15ec821d6a70a1d132f53f50970595efd1b84ee/api/envoy/config/route/v3/route_components.proto#L1570.
*
* The default is 15s.
*
* @param timeout The stream idle timeout, in seconds.
*/
public NativeCronvoyEngineBuilderImpl setStreamIdleTimeoutSeconds(int timeout) {
mPerTryIdleTimeoutSeconds = timeout;
return this;
}

/**
* Adds the boolean value for the reloadable runtime feature flag value. For example, to set the
* Envoy runtime flag `envoy.reloadable_features.http_allow_partial_urls_in_referer` to true,
Expand Down

0 comments on commit 159182a

Please sign in to comment.