[JAVA-2528] Mongo router (mongos) connection pool & timeout trouble Created: 02/Jun/17 Updated: 11/Sep/19 Resolved: 12/Jun/17 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Connection Management |
| Affects Version/s: | 3.2.2 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Burak Bayrakdar | Assignee: | Unassigned |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
I have a question on StackOverflow describing the situation In short the configuration for timeout & connection pool max size was ignored, and driver somehow increased the size of the pool 4x, while connections were not returning or timing out. |
| Comments |
| Comment by Jeffrey Yemin [ 12/Jun/17 ] | |
|
Closing as Cannot Reproduce. We'll be happy to re-open the issue if more information becomes available. | |
| Comment by Jeffrey Yemin [ 12/Jun/17 ] | |
|
Hi Burak, To respond to your last question about maxConnectionLifeTime: that setting only controls the behavior of an idle connection in the connection pool. It will not cause an a socket to be closed abruptly while in use. To force an in-use socket to close, your application would have to set the socketTimeout property in MongoClientOptions. | |
| Comment by Burak Bayrakdar [ 06/Jun/17 ] | |
|
I'd like to ask an extra question also for a solution I am trying to come up with. I tried to utilize maxConnectionLifeTime configuration, with a value of 100, and tested on a script call like;
This connection life time does not kill the above sleep call for example, shouldn't it timeout even if the connection is in use? None of the available timeout configurations kill this kinda connections it seems. | |
| Comment by Burak Bayrakdar [ 05/Jun/17 ] | |
|
There is no proper log to work with, there is no application log, all mongo connections were waiting as normal, without timing out, mongos logs were also pretty OK, the only weird thing that I've found out is that the abnormal connection pool size was not because of my application but due to a monitoring service that is separate from my product. Somehow the mongos instance stopped responding, and due to this, none of the timeout configuration I've set up have worked. I cannot reproduce this state of mongos instance, and sorry for the vagueness of the question, and the lack of details, but this is the situation, I will update the driver version, and try to implement a better logic in my app to respond when mongos instance hangs. In current state app has done nothing, but Apache killed the call since it was > 60 seconds. | |
| Comment by Jeffrey Yemin [ 02/Jun/17 ] | |
|
Are you able to attach application and mongos logs so that we can examine them? Otherwise there's not a lot to go on. |