Skip to content

Conversation

@ReactorScram
Copy link
Contributor

@ReactorScram ReactorScram commented Aug 22, 2024

Closes #6389

I added a retry button since the network change detection is flaky inside Parallels. On bare metal Windows it works fine.

@ReactorScram ReactorScram self-assigned this Aug 22, 2024
@vercel
Copy link

vercel bot commented Aug 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
firezone ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 27, 2024 8:01pm

@ReactorScram ReactorScram changed the base branch from main to fix/gui-connect-without-internet August 22, 2024 18:24
@ReactorScram ReactorScram marked this pull request as ready for review August 22, 2024 19:42
controller.ipc_client.set_dns(resolvers).await?;
},
Status::WaitingForNetwork { token } => {
tracing::debug!("New DNS resolvers, retrying Portal connection...");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this effectively mean we trigger on DNS changes? I suppose on Windows that's pretty reliable, but what's the behavior on Linux?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be DNS changes and network changes on both OSes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only alternative I could think of was polling which didn't sound pleasant

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Copy link
Member

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some ideas on how we can potentially simplify the state machine. Concept ACK though

Base automatically changed from fix/gui-connect-without-internet to main August 23, 2024 15:53
/// Firezone is ready to use.
TunnelReady { resources: Vec<ResourceDescription> },
/// Firezone is signing in to the Portal.
WaitingForPortal {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we gain from splitting Connecting into the two Waiting states? connlib will internally reconnect to the portal if it fails whilst we have the tunnel.

Currently, the fact that we resolve the IPs on startup is somewhat of an implementation detail and that may change again. For example, if we end up doing something like #6427, we may resolve them dynamically on startup and thus, creating phoenix-channel will become infallible again.

I would suggest to not let this implementation detail escape the lower layers and just treat the entire time as Connecting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't affect the behavior, but it's nice to see "Connecting to Portal" in the menu if we're trying to debug something

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is just for debugging, could we also achieve the same with logs? My recommendation would be to not treat the initial boot-up of connlib as two phases. Where it failed in its boot-process shouldn't really matter to the clients.

The above state machine kind of suggests that we would be also showing this when we are internally re-connecting to the portal but we don't. That is completely transparent to the client (until we do #5557).

@ReactorScram ReactorScram enabled auto-merge August 26, 2024 21:41
@ReactorScram ReactorScram added this pull request to the merge queue Aug 27, 2024
Merged via the queue into main with commit b5a67cd Aug 27, 2024
@ReactorScram ReactorScram deleted the fix/gui-reconnect-forever branch August 27, 2024 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(rust/gui-client): Client will never sign in if started with no Internet

4 participants