Skip to content

Conversation

@dkropachev
Copy link

@dkropachev dkropachev commented Mar 13, 2025

SessionManager.replacePool adds pool to the pools map and only afterwards calls .initAsync on it.
For short period of time pool stays in SessionManager.pools uninitialized.
If you close session in that exact time HostConnectionPool.closeAsync is going to endup in panic, because pendingBorrows is null :

java.lang.NullPointerException: null
	at com.datastax.driver.core.HostConnectionPool.closeAsync(HostConnectionPool.java:978)

Fixes: #464

@dkropachev dkropachev requested a review from Bouncheck March 13, 2025 01:15
SessionManager.replacePool adds pool to the pools map and only afterwards calls initAsync.
For short period of time pool stays in `SessionManager.pools`
uninitialized.
If you close session in that exact time `HostConnectionPool.closeAsync`
is going to endup in panic, because `pendingBorrows` is null :
```
java.lang.NullPointerException: null
	at com.datastax.driver.core.HostConnectionPool.closeAsync(HostConnectionPool.java:978)
```
@dkropachev dkropachev force-pushed the dk/fix-host-connection-pool-close-async branch from a04ad3c to da759e5 Compare March 13, 2025 01:16
@dkropachev dkropachev self-assigned this Mar 13, 2025
Copy link

@Bouncheck Bouncheck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dkropachev dkropachev merged commit 2766e50 into scylladb:scylla-3.x Mar 13, 2025
11 checks passed
dkropachev added a commit that referenced this pull request Mar 21, 2025
SessionManager.replacePool adds pool to the pools map and only afterwards calls initAsync.
For short period of time pool stays in `SessionManager.pools`
uninitialized.
If you close session in that exact time `HostConnectionPool.closeAsync`
is going to endup in panic, because `pendingBorrows` is null :
```
java.lang.NullPointerException: null
	at com.datastax.driver.core.HostConnectionPool.closeAsync(HostConnectionPool.java:978)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants