feat(windows): optimise network change detection - #9021
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
thomaseizinger
marked this pull request as ready for review
May 5, 2025 05:14
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes Windows network change detection by filtering duplicate events and ignoring events from the Firezone network adapter to reduce unnecessary startup activity.
- Filters out duplicate network change events
- Adds detection and exclusion for the Firezone network adapter
- Introduces registry lookup to retrieve the Firezone adapter GUID
Comments suppressed due to low confidence (1)
rust/bin-shared/src/network_changes/windows.rs:411
- [nitpick] Consider handling the poisoned mutex lock explicitly rather than unwrapping silently. This can reduce potential hidden issues if the lock is poisoned.
.lock().unwrap_or_else(|e| e.into_inner())
Member
Author
|
@jamilbk Would appreciate if you could give this a brief smoke test on your Windows machine. Disabling the primary network adapter is tricky in a VM because it is the one I am connected to via RDP so I can't really test that. |
thomaseizinger
commented
May 5, 2025
thomaseizinger
enabled auto-merge
May 5, 2025 05:18
jamilbk
reviewed
May 5, 2025
jamilbk
left a comment
Member
There was a problem hiding this comment.
Have a couple questions but otherwise the logic LGTM.
Tested on Windows 11 by switching from WiFi -> Ethernet and back a few a times.
jamilbk
approved these changes
May 6, 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.
Presently, the network change detection on Windows is very naive and simply emits a change event everytime anything changes. We can optimise this and therefore improve the start-up time of Firezone by:
This reduces the number of network change events to 1 during startup. As far as I can tell from the code comments in this area, we explicitly send this one to ensure we don't run into a race condition whilst we are starting up.
Resolves: #8905