SdcRemoteDevicesConnectorImpl#connect does not cleanup threads on error
It was found that for a device that is stopped during initiation of a connection created threads are left running. This is true for any exception that occurs after the subscription to services (#subscribeServices
) and can be easily replicated this way. Exceptions other than PrerequisitesException
are caught and re-thrown as RuntimeException, but there is no cleanup in either case.
My proposal is to add such error handling and cleanup to SdcRemoteDevicesConnectorImpl#connect
. Potentially an interface in HostingServiceProxy
to handle the unsubscription or cleanup would be appropriate.