bitflicker64 commented on code in PR #3416:
URL: https://github.com/apache/hugegraph/pull/3416#discussion_r4397885388
##########
hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/AbstractGrpcClient.java:
##########
@@ -62,32 +53,39 @@ public ManagedChannel[] getChannels(String target) {
if ((tc = channels.get(target)) == null) {
synchronized (channels) {
if ((tc = channels.get(target)) == null) {
+ ManagedChannel[] value = new ManagedChannel[concurrency];
try {
- ManagedChannel[] value = new
ManagedChannel[concurrency];
- CountDownLatch latch = new CountDownLatch(concurrency);
+ // Keep lazy initialization on the calling thread.
Offloading a
Review Comment:
Important: after `closeChannel`, `getAsyncStub(String)` rebuilds its stub
pool with `IntStream.range(0, concurrency).parallel()`, so a Gremlin scan
through `GrpcStoreStreamClient.getStub` fails with `Not allowed to access
thread group via Gremlin` whenever the common `ForkJoinPool` has no idle worker
to wake. Build the async stubs sequentially, as `getBlockingStub(String)` does.
A probe with this head's `HugeSecurityManager` passes the sequential loop
and fails the parallel one from a `gremlin-server-exec` thread once the common
pool has no idle worker.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]