Cursor .close() not finishes in case of multiple close attempts
FDoKE opened this issue · 0 comments
FDoKE commented
Version
4.5.3
Context
CursorImpl.close never finishes promise in case of it's already closed, all logic in !closed branch.
private synchronized void close(Promise<Void> promise) {
if (!closed) {
....
Steps to reproduce
sqlConnection.prepare("select * from test")
.compose(preparedStatement ->
{
Cursor cursor = preparedStatement.cursor();
return cursor.read(1)
.compose(rowSet -> {
Future<Void> close1 = cursor.close();
Future<Void> close2 = cursor.close();
return Future.join(close1, close2)
.onComplete(ar -> {
// never gets called
});
});
});