From ed617cbf3ef21dd2fb671e1821a5d29dac0d5586 Mon Sep 17 00:00:00 2001 From: timtay-microsoft Date: Tue, 12 Sep 2023 08:15:33 -0700 Subject: [PATCH] fix(prov-dev): Fix bug where closing provisioning device client didn't cleanup all threads If the provisioning task was interrupted by the user closing the client, it needs to shutdown its executor service that runs the RegisterTask This fix addresses #1736 --- .../iot/provisioning/device/internal/task/ProvisioningTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/provisioning-device-client/src/main/java/com/microsoft/azure/sdk/iot/provisioning/device/internal/task/ProvisioningTask.java b/provisioning/provisioning-device-client/src/main/java/com/microsoft/azure/sdk/iot/provisioning/device/internal/task/ProvisioningTask.java index c5c293c1ae..e301bcaf8c 100644 --- a/provisioning/provisioning-device-client/src/main/java/com/microsoft/azure/sdk/iot/provisioning/device/internal/task/ProvisioningTask.java +++ b/provisioning/provisioning-device-client/src/main/java/com/microsoft/azure/sdk/iot/provisioning/device/internal/task/ProvisioningTask.java @@ -343,7 +343,7 @@ public Object call() throws Exception this.executeStateMachineForStatus(registrationOperationStatusParser); this.close(); } - catch (ExecutionException | TimeoutException | ProvisioningDeviceClientException | SecurityProviderException e) + catch (ExecutionException | TimeoutException | ProvisioningDeviceClientException | SecurityProviderException | InterruptedException e) { //SRS_ProvisioningTask_25_006: [ This method shall invoke the status callback, if any of the task fail or throw any exception. ] this.dpsStatus = PROVISIONING_DEVICE_STATUS_ERROR;