question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cosmos Client Builder overrides direct connection config idleConnectionTimeout with gateway connection config

See original GitHub issue

This 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:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
allenhumphreyscommented, Jul 10, 2020

Excellent! Thanks @kushagraThapar

0reactions
moderakhcommented, Jul 29, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found