Reset RecoveryActions during uninstall to ensure manual start will be respected #2288
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #2190.
I tested and our original data race theory didn't bear out -- I updated the uninstall function to confirm that the launcher service's start type was set to manual start, and even with backoff and a fresh service handle, the behavior didn't change. I looked in the event logs, and those confirmed that the service's start type was set to demand start (manual) before the service shut down. I also saw in the event logs immediately afterwards that the service manager noted that the launcher svc had terminated unexpectedly and that it would restart in 5 seconds.
Updating the uninstall function to also remove our recovery actions fixed the issue. Now, launcher remains stopped after remote uninstall.