pact-foundation / pact-plugins

🏰 Architecture to support Plugins 🔌 with Pact 🔗
MIT License
19 stars 11 forks source link

gRPC channel reported as not shut down properly #14

Closed rmartine-ias closed 1 year ago

rmartine-ias commented 1 year ago

For the projects where we've implemented use of the gRPC plugin, we're seeing big red "SEVERE" warning messages that look like the following, whenever we run pact tests:

Dec 05, 2022 5:42:15 PM io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference cleanQueue
SEVERE: *~*~*~ Channel ManagedChannelImpl{logId=1, target=[::1]:60118} was not shutdown properly!!! ~*~*~*
    Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true.
java.lang.RuntimeException: ManagedChannel allocation site
        at io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference.<init>(ManagedChannelOrphanWrapper.java:93)
        at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:53)
        at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:44)
        at io.grpc.internal.ManagedChannelImplBuilder.build(ManagedChannelImplBuilder.java:631)
        at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:297)
        at io.pact.plugins.jvm.core.DefaultPluginManager$tryInitPlugin$1.invoke(PluginManager.kt:776)
        at io.pact.plugins.jvm.core.Utils.handleWith(Util.kt:42)
        at io.pact.plugins.jvm.core.DefaultPluginManager.tryInitPlugin(PluginManager.kt:772)
        at io.pact.plugins.jvm.core.DefaultPluginManager.initialisePlugin(PluginManager.kt:755)
        at io.pact.plugins.jvm.core.DefaultPluginManager.loadPlugin(PluginManager.kt:378)
        at au.com.dius.pact.consumer.dsl.PactBuilder.usingPlugin(PactBuilder.kt:97)
        at au.com.dius.pact.consumer.dsl.PactBuilder.usingPlugin$default(PactBuilder.kt:94)
        at au.com.dius.pact.consumer.dsl.PactBuilder.usingPlugin(PactBuilder.kt)
        at io.pact.example.grpc.maven.PactConsumerTest.calculateRectangleArea(PactConsumerTest.java:46)
...

This does not, as far as I can tell, seem to impact the actual functioning of the plugin framework.

This can be reproduced by:

$ cd pact-plugins/examples/gRPC/area_calculator/consumer-maven
$ mvn clean verify

I spent a little time trying to track down the cause, but didn't come up with anything definitive in the time allotted. Here's what I did figure out:

Thank you for your hard work!

rholshausen commented 1 year ago

I think this is due to it trying an IP6 connection first, and then failing back to an IP4 one. That trace is from the first channel not being shutdown (IP6 one), but it doesn't affect anything because it was never used.

rholshausen commented 1 year ago

Released JVM Plugin Driver 0.4.1