[JAVA-3508] ClientSessionBinding.SessionBindingConnectionSource does not retain a reference to its parent binding Created: 13/Nov/19 Updated: 27/Oct/23 Resolved: 22/Nov/19 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | John Stewart (Inactive) | Assignee: | John Stewart (Inactive) |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
ClientSessionBinding.SessionBindingConnectionSource does not call the parent's retain() method in its constructor and the parent's release() method in its own release() method. Curently, SessionBindingConnectionSource#release calls closeSessionIfCountIsZero() which could cause the binding to close prematurely. |
| Comments |
| Comment by John Stewart (Inactive) [ 22/Nov/19 ] |
|
The reference count for ClientSessionBinding is managed by the wrapped AsyncClusterBinding, and, similarly, the reference count for ClientSessionBinding#SessionBindingAsyncConnectionSource is managed by the wrapped AsyncClusterBinding#AsyncClusterBindingConnectionSource which contains a reference to its parent class, AsyncClusterBinding. Therefore, there is no need for ClientSessionBinding#SessionBindingAsyncConnectionSource to maintain a reference to its parent class since the underlying wrapped object maintains the reference. |