[JAVA-834] Set a sane default socketTimeout Created: 23/May/13 Updated: 25/Jun/13 Resolved: 25/Jun/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | 2.11.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jo Voordeckers | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
The current default is to have no socket timeout at all, in case of a replicaset when a primary is not reachable this blocks server threads that try to write. Trace logs: Thread Synchronization Statistics: |
| Comments |
| Comment by Jeffrey Yemin [ 23/May/13 ] |
|
So set the socketTimeout=2000. The reason we don't set a socket timeout by default is that queries can be slow if they are un-indexed and there is a lot of documents, so anything we choose would be arbitrary. |
| Comment by Jo Voordeckers [ 23/May/13 ] |
|
We're not handling that many reqs, but at least with a short timeout the application has more chances of keeping up before it collapses. |
| Comment by Jeffrey Yemin [ 23/May/13 ] |
|
I don't consider this a blocker since there is a simple workaround. Won't a 120 second timeout cause thread starvation as well? How many requests/second are you handling? |