netbird icon indicating copy to clipboard operation
netbird copied to clipboard

client/server/server.go->Status() returns connected when WiFi Dropouts

Open hurricanehrndz opened this issue 1 year ago • 4 comments

Describe the problem

client/server/server.go->Status() returns a status connected when WiFi is suddenly disconnected this contradicts the output of netbird status that accurately reflects the connection state

This results in the menubar/systray item inaccurately reflecting the connection state, is this oversight or an actual design decission?

To Reproduce

Steps to reproduce the behavior: On macOS

  1. Connect
  2. Turn off WiFi
  3. Icon indicates I am successfully connected when it is impossible

Expected behavior

Icon should accurately reflect the connection state

Are you using NetBird Cloud? Nope

NetBird version 0.27.3

NetBird status -d output:

NA

hurricanehrndz avatar May 06 '24 14:05 hurricanehrndz

@hurricanehrndz, the connected status has the following behavior:

  1. connection to the management and signal servers: they are handled by the grpc client and have a 10s timeout; this may cause an invalid status during this timeout
  2. P2P connections are not considered in the status response; they are additional to the management/signal status

If the status is not updating after a few seconds, that's an issue.

We are working on a network monitor, https://github.com/netbirdio/netbird/pull/1904, which will respond to network changes, especially the ones that touch the default gateway.

mlsmaycon avatar May 07 '24 08:05 mlsmaycon

Thanks for the info, internal state is in server is never updated when connection to Signal or Management endpoint is terminated. Not sure if it should though

hurricanehrndz avatar May 08 '24 13:05 hurricanehrndz

I will attempt to test with the network monitor and report my findings

hurricanehrndz avatar May 13 '24 16:05 hurricanehrndz

Network monitor will not work in our testing. It does too much and creates more issues than it helps solves. I maybe able to work around it, if I can change https://github.com/netbirdio/netbird/blob/main/client/server/server.go#L615 to optionally run probes.

hurricanehrndz avatar May 14 '24 19:05 hurricanehrndz

Never mind, network monitor does help

hurricanehrndz avatar May 17 '24 21:05 hurricanehrndz