[
https://issues.apache.org/jira/browse/TINKERPOP-2597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17396137#comment-17396137
]
Pim Hazebroek commented on TINKERPOP-2597:
------------------------------------------
I looked into this issue in more details, (I'm a co-worker of the author of
this ticket) and here are my findings:
When a `CompletionException` occurs in the constructor of the ConnectionPool,
the `open` field is still null. So the closeAsync won't work and cannot
gracefully close any connections that might have been created.
> NullPointerException while initializing connection pool
> -------------------------------------------------------
>
> Key: TINKERPOP-2597
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2597
> Project: TinkerPop
> Issue Type: Bug
> Components: driver
> Affects Versions: 3.5.0
> Reporter: Winston P.
> Priority: Major
>
> When are experiencing an occasional NullPointerException during connection
> pool initialization. It seems that there is an error while trying to connect
> to the gremlin database (in our case on Azure). The error triggers the pool
> to try and kill available connections which results in an unhandled
> NullPointerException. As a result the original exception is swallowed and the
> pool never recovers from this state.
>
> {code:java}
> java.lang.RuntimeException: Could not initialize client for
> Host{address=xxxx.gremlin.cosmos.azure.com/10.10.10.10:443,
> hostUri=wss://xxxx.gremlin.cosmos.azure.com:443/gremlin}
> at
> org.apache.tinkerpop.gremlin.driver.Client$ClusteredClient.lambda$new$4(Client.java:571)
> ~[gremlin-driver-3.5.0.jar!/:3.5.0]
> at
> org.apache.tinkerpop.gremlin.driver.Client$ClusteredClient.lambda$null$0(Client.java:529)
> ~[gremlin-driver-3.5.0.jar!/:3.5.0]
> at
> java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source)
> ~[na:na]
> at
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> ~[na:na]
> at
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> ~[na:na]
> at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]
> Caused by: java.lang.NullPointerException: null
> at
> org.apache.tinkerpop.gremlin.driver.ConnectionPool.killAvailableConnections(ConnectionPool.java:273)
> ~[gremlin-driver-3.5.0.jar!/:3.5.0]
> at
> org.apache.tinkerpop.gremlin.driver.ConnectionPool.closeAsync(ConnectionPool.java:256)
> ~[gremlin-driver-3.5.0.jar!/:3.5.0]
> at
> org.apache.tinkerpop.gremlin.driver.ConnectionPool.<init>(ConnectionPool.java:115)
> ~[gremlin-driver-3.5.0.jar!/:3.5.0]
> at
> org.apache.tinkerpop.gremlin.driver.ConnectionPool.<init>(ConnectionPool.java:78)
> ~[gremlin-driver-3.5.0.jar!/:3.5.0]
> at
> org.apache.tinkerpop.gremlin.driver.Client$ClusteredClient.lambda$new$4(Client.java:565)
> ~[gremlin-driver-3.5.0.jar!/:3.5.0]
> ... 5 common frames omitted {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)