Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

While starting managed channels on client we get error: Channel for target was not shutdown properly!!! #4

Closed
thinkerou opened this issue Oct 10, 2018 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@thinkerou
Copy link
Member

When run bi-stream.feature case I get the follow error:

Oct 10, 2018 11:15:36 AM io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference cleanQueue
严重: *~*~*~ Channel ManagedChannelImpl{logId=4, target=localhost:50051} 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:103)
        at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:53)
        at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:44)
        at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:410)
        at com.github.thinkerou.karate.grpc.ChannelFactory.create(ChannelFactory.java:15)
        at com.github.thinkerou.karate.service.GrpcCall.<init>(GrpcCall.java:51)
        at com.github.thinkerou.karate.service.GrpcCall.create(GrpcCall.java:47)
        at com.github.thinkerou.karate.GrpcClient.create(GrpcClient.java:24)
        at jdk.nashorn.internal.scripts.Script$8$\^eval\_.:program(<eval>:1)
        at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
        at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
        at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:449)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:406)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:402)
        at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155)
        at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)
        at com.intuit.karate.ScriptBindings.eval(ScriptBindings.java:139)
        at com.intuit.karate.ScriptBindings.updateBindingsAndEval(ScriptBindings.java:134)
        at com.intuit.karate.ScriptBindings.evalInNashorn(ScriptBindings.java:119)
        at com.intuit.karate.Script.evalJsExpression(Script.java:371)
        at com.intuit.karate.Script.evalKarateExpression(Script.java:285)
        at com.intuit.karate.Script.evalKarateExpression(Script.java:171)
        at com.intuit.karate.Script.assign(Script.java:601)
        at com.intuit.karate.Script.assign(Script.java:527)
        at com.intuit.karate.StepDefs.def(StepDefs.java:309)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at cucumber.runtime.Utils$1.call(Utils.java:40)
        at cucumber.runtime.Timeout.timeout(Timeout.java:16)
        at cucumber.runtime.Utils.invoke(Utils.java:34)
        at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:38)
        at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
        at com.intuit.karate.cucumber.CucumberUtils.runStep(CucumberUtils.java:201)
        at com.intuit.karate.cucumber.KarateRuntime.runStep(KarateRuntime.java:86)
        at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
        at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
        at cucumber.runtime.model.CucumberScenario.runBackground(CucumberScenario.java:59)
        at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:42)
        at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:165)
        at com.intuit.karate.cucumber.CucumberRunner.lambda$parallel$0(CucumberRunner.java:101)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Oct 10, 2018 11:15:36 AM io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference cleanQueue
严重: *~*~*~ Channel ManagedChannelImpl{logId=7, target=localhost:50051} 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:103)
        at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:53)
        at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:44)
        at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:410)
        at com.github.thinkerou.karate.grpc.ChannelFactory.create(ChannelFactory.java:15)
        at com.github.thinkerou.karate.service.GrpcCall.<init>(GrpcCall.java:51)
        at com.github.thinkerou.karate.service.GrpcCall.create(GrpcCall.java:47)
        at com.github.thinkerou.karate.GrpcClient.create(GrpcClient.java:24)
        at jdk.nashorn.internal.scripts.Script$8$\^eval\_.:program(<eval>:1)
        at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
        at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
        at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:449)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:406)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:402)
        at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155)
        at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)
        at com.intuit.karate.ScriptBindings.eval(ScriptBindings.java:139)
        at com.intuit.karate.ScriptBindings.updateBindingsAndEval(ScriptBindings.java:134)
        at com.intuit.karate.ScriptBindings.evalInNashorn(ScriptBindings.java:119)
        at com.intuit.karate.Script.evalJsExpression(Script.java:371)
        at com.intuit.karate.Script.evalKarateExpression(Script.java:285)
        at com.intuit.karate.Script.evalKarateExpression(Script.java:171)
        at com.intuit.karate.Script.assign(Script.java:601)
        at com.intuit.karate.Script.assign(Script.java:527)
        at com.intuit.karate.StepDefs.def(StepDefs.java:309)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at cucumber.runtime.Utils$1.call(Utils.java:40)
        at cucumber.runtime.Timeout.timeout(Timeout.java:16)
        at cucumber.runtime.Utils.invoke(Utils.java:34)
        at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:38)
        at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
        at com.intuit.karate.cucumber.CucumberUtils.runStep(CucumberUtils.java:201)
        at com.intuit.karate.cucumber.KarateRuntime.runStep(KarateRuntime.java:86)
        at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
        at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
        at cucumber.runtime.model.CucumberScenario.runBackground(CucumberScenario.java:59)
        at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:42)
        at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:165)
        at com.intuit.karate.cucumber.CucumberRunner.lambda$parallel$0(CucumberRunner.java:101)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
@thinkerou thinkerou added the bug Something isn't working label Oct 10, 2018
@thinkerou
Copy link
Member Author

grpc-java ref: grpc/grpc-java#4032

@thinkerou thinkerou self-assigned this Oct 10, 2018
@thinkerou
Copy link
Member Author

If have not call onNext will occur the error, like:

    @Override
    public StreamObserver<RouteNote> routeChat(final StreamObserver<RouteNote> responseObserver) {
        return new StreamObserver<RouteNote>() {
            @Override
            public void onNext(RouteNote routeNote) {
                List<RouteNote> notes = getOrCreateNotes(routeNote);

                for (RouteNote preNote : notes.toArray(new RouteNote[0])) {
                    // HERE:
                    // If not arrive here, it will error.!!!!
                    responseObserver.onNext(preNote);
                }

                notes.add(routeNote);
            }

            @Override
            public void onError(Throwable throwable) {
                logger.warning("RouteChat cancelled");
            }

            @Override
            public void onCompleted() {
                responseObserver.onCompleted();
            }
        };
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant