Skip to content

Commit 00e9f96

Browse files
authored
Fix a problem where it takes a long time to close a handle
1 parent 90dec04 commit 00e9f96

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
88
- Cloud only: added new OCI regions (TYO, AHU, DAC, DOH, IZQ)
99
- Cloud only: added use of ETag in AddReplicaRequest and DropReplicaRequest
1010

11+
### Fixed
12+
- Changed handle close to not use the Netty "quiet period" when shutting down
13+
the worker group. This makes handle close much faster as well as making it
14+
faster to acquire authentication information in the cloud service when using a
15+
method that uses an HTTP request such as Instance Principal authentication
16+
1117
## [5.4.14] 2023-11-17
1218

1319
### Added

driver/src/main/java/oracle/nosql/driver/httpclient/HttpClient.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,16 @@ ConnectionPool getConnectionPool() {
366366
*/
367367
public void shutdown() {
368368
pool.close();
369-
workerGroup.shutdownGracefully().syncUninterruptibly();
369+
/*
370+
* 0 means no quiet period, waiting for more tasks
371+
* 5000ms is total time to wait for shutdown (should never take this
372+
* long
373+
*
374+
* See doc:
375+
* https://netty.io/4.1/api/io/netty/util/concurrent/EventExecutorGroup.html#shutdownGracefully--
376+
*/
377+
workerGroup.shutdownGracefully(0, 5000, TimeUnit.MILLISECONDS).
378+
syncUninterruptibly();
370379
}
371380

372381
public Channel getChannel(int timeoutMs)

0 commit comments

Comments
 (0)