Skip to content
This repository was archived by the owner on Jan 18, 2025. It is now read-only.
This repository was archived by the owner on Jan 18, 2025. It is now read-only.

ManagedChannelImpl was not shutdown properly #58

@jasperrosiers

Description

@jasperrosiers

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());
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions