LF-Decentralized-Trust-labs / paladin

Programmable privacy for EVM
https://lf-decentralized-trust-labs.github.io/paladin
Apache License 2.0
16 stars 6 forks source link

Java gRPC code fails in docker build with `Uncaught exception in the SynchronizationContext. Panic!` #239

Open peterbroadhurst opened 1 month ago

peterbroadhurst commented 1 month ago

Looks like we've not got everything we need in our Jar build

Following lead from: https://stackoverflow.com/a/63474092/21677265

Sep 30, 2024 1:07:42 AM io.grpc.internal.ManagedChannelImpl$3 uncaughtException
SEVERE: [Channel<1>: (directaddress:////tmp/p.1.sock)] Uncaught exception in the SynchronizationContext. Panic!
java.lang.IllegalStateException: Could not find policy 'pick_first'. Make sure its implementation is either registered to LoadBalancerRegistry or included in META-INF/services/io.grpc.LoadBalancerProvider from your jar files.
        at io.grpc.internal.AutoConfiguredLoadBalancerFactory$AutoConfiguredLoadBalancer.<init>(AutoConfiguredLoadBalancerFactory.java:94)
        at io.grpc.internal.AutoConfiguredLoadBalancerFactory.newLoadBalancer(AutoConfiguredLoadBalancerFactory.java:61)
        at io.grpc.internal.ManagedChannelImpl.exitIdleMode(ManagedChannelImpl.java:418)
        at io.grpc.internal.ManagedChannelImpl$RealChannel$2.run(ManagedChannelImpl.java:895)
        at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:94)
        at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:126)
        at io.grpc.internal.ManagedChannelImpl$RealChannel.newCall(ManagedChannelImpl.java:892)
        at io.grpc.internal.ManagedChannelImpl.newCall(ManagedChannelImpl.java:834)
        at io.grpc.internal.ForwardingManagedChannel.newCall(ForwardingManagedChannel.java:63)
        at io.kaleido.paladin.toolkit.PluginControllerGrpc$PluginControllerStub.initLoader(PluginControllerGrpc.java:307)
        at io.kaleido.paladin.loader.PluginLoader.connectAndInit(PluginLoader.java:108)
        at io.kaleido.paladin.loader.PluginLoader.lambda$scheduleConnect$1(PluginLoader.java:132)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)

01:07:42.341 [main] ERROR io.kaleido.paladin.Main - exiting with error: 1
peterbroadhurst commented 1 month ago

Don't know which of the grpc- packages it's in, but it's not grpc-grpclb for the io.grpc.internal.PickFirstLoadBalancerProvider.

... I was able to find the class in IntelliJ after importing grpc-all instead of all the mini packages, so trying that.

peterbroadhurst commented 1 month ago

This seems to have fixed it: https://github.com/kaleido-io/paladin/pull/236/commits/df9becea56adbba5b84f112309056b454c03be67

github-actions[bot] commented 1 week ago

This issue is stale because it has been open 30 days with no activity.