Cosmos Client Builder overrides direct connection config idleConnectionTimeout with gateway connection config
See original GitHub issueThis is a bug which popped up in this ICM: https://portal.microsofticm.com/imp/v3/incidents/details/194516399/home
In the below code ->
if (this.directConnectionConfig != null) {
this.connectionPolicy = new ConnectionPolicy(directConnectionConfig);
// Check if the user passed additional gateway connection configuration
if (this.gatewayConnectionConfig != null) {
this.connectionPolicy.setMaxConnectionPoolSize(this.gatewayConnectionConfig.getMaxConnectionPoolSize());
this.connectionPolicy.setRequestTimeout(this.gatewayConnectionConfig.getRequestTimeout());
// gateway config overrides direct config right here
this.connectionPolicy.setIdleConnectionTimeout(this.gatewayConnectionConfig.getIdleConnectionTimeout());
}
If both directConnectionConfig
and gatewayConnectionConfig
are present, then idleConnectionTimeout will always be overriden by gatewayConnectionConfig
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Connection configurations for Azure Cosmos DB Java SDK v4 ...
You can configure the connection mode in the client builder using the directMode() method as shown below. To configure direct mode with default...
Read more >DirectConnectionConfig (Azure SDK for Java Reference ... - NET
Represents the connection config with ConnectionMode.DIRECT associated with Cosmos Client in the Azure Cosmos DB database service.
Read more >Configuration Properties - Microsoft Open Source
Connect timeout for direct client, represents timeout for establishing connections ... spring.cloud.azure.cosmos.direct-connection.idle-connection-timeout.
Read more >How can I increase the request timeout in Java SDK v4 for ...
You could consider the following recommendations,. The following should help to address the issue: Try to increase http connection pool size ...
Read more >com.microsoft.azure.documentdb.ConnectionPolicy java code ...
idleConnectionTimeout ", connectionPolicy. ... setUserAgentSuffix(userAgent); return new DocumentClient(config. ... Gets the default connection policy.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Excellent! Thanks @kushagraThapar
our P99 latency for items of size 1KB is < 10ms however for some corner case scenario (query payload being huge, etc), the server side contract is to respond in 5 seconds, this is the reason the SDK default is 5 seconds.
I don’t think this will be hit on the normal path though. You can set it to 2 seconds provided that you are aware of the above.