-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix SimulatedTemperatureSensor Module Status Issues on Stop command (#…
…7420) Issue description: **Expected Behavior** When changing the module status from Running to Stopped via the Azure portal, the module on the device should stop successfully. **Actual Behavior** After setting the module to Stopped, running sudo iotedge list shows the SimulatedTemperatureSensor module in a Failed (139) state instead of Stopped. **Fix: ** This pull request addresses the issues causing the SimulatedTemperatureSensor module to fail with exit code 139 when it receives a stop command from the Azure portal. Initially, the SimulatedTemperatureSensor module encountered exit code 139 due to improper handling of task cancellations, leading to a segmentation fault. To address this, handling for TaskCanceledException was added in the SendEvents method to log a message when the task is canceled. Changes made: - Added handling for TaskCanceledException in the SendEvents method to log a message when the task is canceled. - Setting the Environment.ExitCode to 0 indicating the successful exit. - Replacing the Console statements with logger. These changes address the issues causing the SimulatedTemperatureSensor module to fail with exit codes 139 and 143, ensuring the module transitions to the stopped state correctly.  ## Azure IoT Edge PR checklist:
- Loading branch information
Showing
2 changed files
with
43 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters