-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(gui-client): proof of concept for process splitting #4788
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Terraform Cloud Plan Output
|
Performance Test ResultsTCP
UDP
|
self.tun = Some(Tun::new(config, dns_config, callbacks)?); | ||
self.tun = Some(Tun::new(config, dns_config.clone(), callbacks)?); | ||
|
||
callbacks.on_set_interface_config(config.ipv4, config.ipv6, dns_config); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appeared to be missing from the Linux impl, I need it to act as on_tunnel_ready
// TODO: Should this default to 30 days? | ||
let max_partition_time = cli.max_partition_time.map(|d| d.into()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if I pass None
for max partition time?
@@ -513,7 +521,7 @@ struct Session { | |||
impl Controller { | |||
// TODO: Figure out how re-starting sessions automatically will work |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Clients don't need to automatically restart connlib sessions, do they? This comment might be out of date.
// TODO: Make sure this joins / drops somewhere | ||
let recv_task = tokio_handle.spawn(async move { | ||
while let Some(msg) = rx.next().await { | ||
let msg = msg?; | ||
let msg: IpcServerMsg = serde_json::from_slice(&msg)?; | ||
match msg { | ||
IpcServerMsg::Ok => {} | ||
IpcServerMsg::OnDisconnect => callback_handler.on_disconnect( | ||
&connlib_client_shared::Error::Other("errors can't be serialized"), | ||
), | ||
IpcServerMsg::OnUpdateResources(v) => callback_handler.on_update_resources(v), | ||
IpcServerMsg::TunnelReady => callback_handler.on_tunnel_ready(), | ||
} | ||
} | ||
Ok(()) | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The IPC itself could probably use improvement, maybe one of those poll functions like I use for signals and disconnect somewhere else in the PR.
This is working enough for a demo
} | ||
|
||
// Callbacks must all be non-blocking | ||
// TODO: DRY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 4 of these CallbackHandler
structs now, but they're all subtly different, so I didn't try to de-dupe them yet.
I considered trying to fit them all into a "wake-and-poll" pattern but this would probably make the code longer, not shorter, and it would make the IPC protocol a little more chatty. (e.g. instead of the service just sending new resources to the Client, it would send a wake, then the Client would make a request, then the service would respond. I think this is more robust if the system is CPU-starved but in practice it probably doesn't matter at all.)
Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense. Just verifying -- by merging this we aren't blocking any bugfix updates that the Windows client might need, correct?
Blocking as in, causing merge conflicts, or taking time away from them? I don't think there's anything important on Windows, there's a couple issues which are either not replicating or aren't critical https://github.com/firezone/firezone/issues?q=is%3Aopen+is%3Aissue+label%3Aarea%2Fwindows_client+ |
I smoke-tested the MSI built from bbba458 and it passed. Signs in, controls DNS, ifconfig.net goes through the tunnel |
SGTM |
I accidentally modified a function that's used in both Android and Linux, this PR splits it up into two functions
Closes #4270
Refs #3713
Refs #3782
It sort-of works, but many features are missing and it needs a refactor.
Tasks
imp_linux.rs
into modulestry_send
and panics where possible