-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
I found issue while reading how Lettuce integration works in this method:
Lines 966 to 975 in 777f079
protected StatefulConnection<byte[], byte[]> doGetAsyncDedicatedConnection() { | |
StatefulConnection<byte[], byte[]> connection = getConnectionProvider().getConnection(StatefulConnection.class); | |
if (customizedDatabaseIndex()) { | |
potentiallySelectDatabase(this.dbIndex); | |
} | |
return connection; | |
} |
The method creates a new connection, which is stored by the caller into a asyncDedicatedConnection
attribute:
Lines 1026 to 1033 in 777f079
private StatefulConnection<byte[], byte[]> getOrCreateDedicatedConnection() { | |
if (this.asyncDedicatedConnection == null) { | |
this.asyncDedicatedConnection = doGetAsyncDedicatedConnection(); | |
} | |
return this.asyncDedicatedConnection; | |
} |
But it looks like the asyncDedicatedConnection
is used before assignment in potentiallySelectDatabase()
called by doGetAsyncDedicatedConnection()
:
Lines 1068 to 1073 in 777f079
private void potentiallySelectDatabase(int dbIndex) { | |
if (asyncDedicatedConnection instanceof StatefulRedisConnection<byte[], byte[]> statefulConnection) { | |
statefulConnection.sync().select(dbIndex); | |
} | |
} |
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug