-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(windows-agent): Don't bail out if WSL adapter is not available (#896
) The key of this PR is enable a sensible behaviour for the Windows agent when there is no WSL network adapter, which is also when there is no WSL instance registered. It's behaviour remain changed otherwise. When started under such condition: - The proservices skip registering the WSL instance gRPC service - The daemon subscribes to OS notifications related to additions of network interfaces - If triggered with the WSL adapter in the list of new interfaces recently added, restarts itself, i.e. * stops the current gRPC server and * creates a new one with all proservices enabled A live demonstration of this huge patch on a fresh VM with the latest stable WSL and Ubuntu-24.04 from the package flight: https://github.com/user-attachments/assets/e35f36b8-318b-4d98-b6ab-0b59f4b1fff1 The daemon was not meant to be restarted, thus a huge part of this diff is changing its internals while preserving its interface and most of its semantics. Clients (agent app) and collaborators (proservices) are mostly unaffected by such changes. I implemented the OS notification component as a thin wrapper on top of the Windows registry relying on the stability of the network control set registry path. It's maintained by the operating system and match the behaviour observed with the virtual adapters (not removed when the last WSL instance is unregistered, until system reboot). When discussing WS035 we agreed in not exposing the registry as much looking into the possibility of reimplementing that layer using a more specific API. I didn't find yet any Win32 API suitable for use in Go without CGo that offers the flexibility I found in the registry. As you can notice in the recording, the daemon is restarted much before the newly registered instance is ready, thus wsl-pro-service doesn't require any changes. By the time systemd kicks in, the agent is already listening. There was one line removal on the GUI side to prevent it from deleting the `.address` file upfront if it finds the agent non-responsive, which could be the case of the daemon restarting. The GUI attempts to read the `.address` file, if not found then it attempts to start the agent application. --- UDENG-3838
- Loading branch information
Showing
16 changed files
with
1,175 additions
and
135 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
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
Oops, something went wrong.