Skip to content

Commit d9f378b

Browse files
committed
Speeding up the shutdown of the driver.
1 parent 6dbc1fa commit d9f378b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

driver/src/main/java/org/neo4j/driver/internal/async/pool/ConnectionPoolImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.util.concurrent.CompletionStage;
3131
import java.util.concurrent.ConcurrentHashMap;
3232
import java.util.concurrent.ConcurrentMap;
33+
import java.util.concurrent.TimeUnit;
3334
import java.util.concurrent.TimeoutException;
3435
import java.util.concurrent.atomic.AtomicBoolean;
3536

@@ -165,7 +166,10 @@ public CompletionStage<Void> close()
165166
}
166167
finally
167168
{
168-
eventLoopGroup().shutdownGracefully();
169+
// This is an attempt to speed up the shut down procedure of the driver
170+
// Feel free return this back to shutdownGracefully() method with default values
171+
// if this proves troublesome!!!
172+
eventLoopGroup().shutdownGracefully(200, 15_000, TimeUnit.MILLISECONDS);
169173
}
170174
}
171175
return Futures.asCompletionStage( eventLoopGroup().terminationFuture() )

0 commit comments

Comments
 (0)