[JAVA-3206] Fix connection pool race condition Created: 14/Feb/19 Updated: 28/Oct/23 Resolved: 27/Feb/19 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Connection Management |
| Affects Version/s: | None |
| Fix Version/s: | 3.11.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeffrey Yemin | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
There is a race condition in the DefaultConnectionPool class between the maintenance task thread and the constructor for the class. The race can be fixed by deferring starting the maintenance task thread to a start method that's called immediately after the constructor completes, which will ensure that all final fields of the class are published (in the JVM memory model sense of the word) |
| Comments |
| Comment by Githook User [ 27/Feb/19 ] |
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}Message: Fix race condition in DefaultConnectionPool constructor The race condition is due to the constructor starting a thread which The fix is to defer starting the thread to a start method that the
|