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

ManagedChannelImpl was not shutdown properly #58

Open
jasperrosiers opened this issue Jan 18, 2021 · 3 comments
Open

ManagedChannelImpl was not shutdown properly #58

jasperrosiers opened this issue Jan 18, 2021 · 3 comments

Comments

@jasperrosiers
Copy link

The error I put below, where a ManagedChannel was not shut down properly. I have read this issue, but couldn't find a solution: .

I have basically completely copied the code from Google's docs. I will put the faulty class below the error as well. I have tried finding a "shutdown" method on all of the variables, but there aren't any, so I'm not sure what I should do.

2021-01-18 19:21:59.443 ERROR 1 --- [nio-8080-exec-8] i.g.i.ManagedChannelOrphanWrapper        : *~*~*~ Channel ManagedChannelImpl{logId=157, target=homegraph.googleapis.com} 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) ~[grpc-core-1.15.1.jar!/:1.15.1]                                                                                  │
│     at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:53) ~[grpc-core-1.15.1.jar!/:1.15.1]                                                                                                           │
│     at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:44) ~[grpc-core-1.15.1.jar!/:1.15.1]                                                                                                           │
│     at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:410) ~[grpc-core-1.15.1.jar!/:1.15.1]                                                                                               │
│     at com.google.actions.api.smarthome.SmartHomeApp.reportState(SmartHomeApp.kt:126) ~[actions-on-google-1.8.0.jar!/:na]                                                                                                                  │
│     at ordina.engie.googlehome.google.services.ReportStateService.reportState(ReportStateService.java:41) ~[classes!/:0.0.1-SNAPSHOT]                                                                                                      │
│     at ordina.engie.googlehome.toon.controllers.ToonController.reportToGoogle(ToonController.java:27) ~[classes!/:0.0.1-SNAPSHOT]

The method where the error happens:

public void reportState(String requestId, String commonName, ThermostatInfo thermostatInfo) {
        Value deviceStates =
                Value.newBuilder()
                        .setStructValue(
                                Struct.newBuilder()
                                        .putFields(HOME_RESPONSE_KEY_ONLINE, Value.newBuilder().setBoolValue(true).build())
                                        .putFields(HOME_RESPONSE_KEY_MODE, Value.newBuilder().setStringValue(smartHomeHelperService.calculateThermostatMode(thermostatInfo)).build())
                                        .putFields(HOME_RESPONSE_KEY_SETPOINT, Value.newBuilder().setNumberValue(thermostatInfo.getCurrentSetpoint()).build())
                                        .putFields(HOME_RESPONSE_KEY_AMBIENT, Value.newBuilder().setNumberValue(thermostatInfo.getCurrentDisplayTemp()).build())
                                        .build())
                        .build();

        Struct requestStates = Struct.newBuilder().putFields(commonName, deviceStates).build();

        HomeGraphApiServiceProto.ReportStateAndNotificationResponse response =
                engieSmartHomeAppService.reportState(
                        HomeGraphApiServiceProto.ReportStateAndNotificationRequest.newBuilder()
                                .setRequestId(requestId)
                                .setAgentUserId(commonName)
                                .setPayload(
                                        HomeGraphApiServiceProto.StateAndNotificationPayload.newBuilder()
                                                .setDevices(
                                                        HomeGraphApiServiceProto.ReportStateAndNotificationDevice.newBuilder()
                                                                .setStates(requestStates)
                                                                .build())
                                                .build())
                                .build());
    }
@jiangxin369
Copy link

Hi, I just faced the same issue, does anyone know the reason?

@aykborstelmann
Copy link

Me too

@EgHubs
Copy link

EgHubs commented Apr 28, 2022

Same here,
this PR is supposed to fix it
but I can't apply it, what I faced it I described it here
Does anyone know how to apply that PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants