[JAVA-3433] Concurrency issue when closing server session pool Created: 12/Sep/19 Updated: 28/Oct/23 Resolved: 31/Oct/19 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Session Management |
| Affects Version/s: | None |
| Fix Version/s: | 3.11.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeffrey Yemin | Assignee: | John Stewart (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
| Comments |
| Comment by Githook User [ 05/Nov/19 ] |
|
Author: {'name': 'John Stewart', 'username': 'jstewart-mongo', 'email': 'john.stewart@mongodb.com'}Message: Fix concurrency issue when closing sessions in ServerSessionPool
|
| Comment by Githook User [ 31/Oct/19 ] |
|
Author: {'username': 'jstewart-mongo', 'email': 'john.stewart@mongodb.com', 'name': 'John Stewart'}Message: Fix concurrency issue when closing sessions in ServerSessionPool
|
| Comment by John Stewart (Inactive) [ 27/Oct/19 ] |
|
jeff.yemin I did see that there was some defensive code in the close and closeSession methods in ServerSessionPool, but after considering your suggestion, I can see where the concurrency issue can occur. Reopening to investigate further. |
| Comment by Jeffrey Yemin [ 27/Oct/19 ] |
|
In that case I would suspect a concurrency issue in the ServerSessionPool. It does look like closedSessionIdentifiers could be involved in a race condition if ServerSessionPool#close executes concurrently with ServerSessionPool#closeSession. |
| Comment by John Stewart (Inactive) [ 25/Oct/19 ] |
|
The failure did not reproduce either locally or on Evergreen using the commit where the failure appeared. It can be surmised that the value from the BsonArray in `BsonArrayCodec#encode` became null, but analyzing the call stack did not produce a scenario in which this could happen. The method `Object#getClass` cannot return null, and `codecRegistry` has a `notNull` annotation. |