fix: various fixes for tunnel startup to work#14
Merged
deansheather merged 5 commits intomainfrom Jan 31, 2025
Merged
Conversation
Fixes various problems that prevented tunnel startup from succeeding and prevented clients from connecting to the RPC server. Added a new temporary package Vpn.DebugClient to help control the system service component until the UI is ready. Adds utility PS1 scripts for adding the debug binary to a new system service and managing/hotswapping it.
spikecurtis
reviewed
Jan 29, 2025
| await DownloadTunnelBinaryAsync(message.Message.Start.CoderUrl, serverVersion, ct); | ||
| await _tunnelSupervisor.StartAsync(_config.TunnelBinaryPath, HandleTunnelRpcMessage, | ||
| HandleTunnelRpcError, | ||
| await _tunnelSupervisor.StartAsync(_config.TunnelBinaryPath, HandleTunnelRpcMessage, HandleTunnelRpcError, |
Collaborator
There was a problem hiding this comment.
same with this section: we need to ensure that stops and starts are serialized so that you don't get stop, stop, start, start if two clients connect around the same time.
Member
Author
There was a problem hiding this comment.
Added a semaphore that fixes both of these issues
|
|
||
| public async Task BroadcastAsync(ServiceMessage message, CancellationToken ct) | ||
| { | ||
| foreach (var (clientId, client) in _activeClients) |
Collaborator
There was a problem hiding this comment.
Is there anything that prevents _activeClients from being modified while you are looping over it?
Member
Author
There was a problem hiding this comment.
Since it's a concurrent dictionary it's exception-safe. As far as I understand, any added or removed items from the dictionary while we're looping may or may not get called, but I think that's fine.
spikecurtis
approved these changes
Jan 30, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes various problems that prevented tunnel startup from succeeding and prevented clients from connecting to the RPC server.
Added a new temporary package Vpn.DebugClient to help control the system service component until the UI is ready.
Adds utility PS1 scripts for adding the debug binary to a new system service and managing/hotswapping it.
Start and stop operations from a client now reliably work, although there are various TODOs around the service codebase still.
Closes #2