Add logic to force terminate the VM if the session lock can't be acquired for 30 seconds when the service stops by OneBlue · Pull Request #13493 · microsoft/WSL

Summary of the Pull Request

This change adds new logic to force terminate the VM if we can't acquire the user session lock for 30 seconds. This should help avoid MSI installation being stuck because wslservice is waiting on the lock to terminate the VM (See #11013).

Thiswill only help when upgrading into a build that contains this commit, so we should expect the new upgrade to show the same issues.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed