Skip to content
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

protocol: stop using LastSeen so much #2107

Closed
bradfitz opened this issue Jun 11, 2021 · 2 comments
Closed

protocol: stop using LastSeen so much #2107

bradfitz opened this issue Jun 11, 2021 · 2 comments
Assignees

Comments

@bradfitz
Copy link
Member

Historically, the control plane server has sent updated Node.LastSeen values every 10 minutes. That's a lot of the traffic coming from the server to clients (tailscaled), but it's basically never used. It's used for two things only:

  • when TCP connections fail, lastSeen is logged
  • when CLI file sends fail, lastSeen is printed to stderr

But we have the Online bool which is more interesting, which is also logged.

We plan to stop assuming lastSeen is present and only mention it in logs/output when it is.

Then we plan to fix the control server to actually do as we'd recently documented LastSeen in 670838c:

        // LastSeen is when the node was last online. It is not                                                                                                                                  
        // updated when Online is true. It is nil if the current                                                                                                                                 
        // node doesn't have permission to know, or the node                                                                                                                                     
        // has never been online.                                                                                                                                                                
        LastSeen *time.Time `json:",omitempty"`

So effectively, LastSeen becomes what the control server calls GoneAt, when the node stopped being online. That changes rarely, rather than every 10 minutes.

@bradfitz bradfitz self-assigned this Jun 11, 2021
bradfitz added a commit that referenced this issue Jun 11, 2021
…apver 20]

Updates #2107

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
@DentonGentry
Copy link
Contributor

Still used in file cp message:

d := time.Since(*n.LastSeen)

@bradfitz
Copy link
Member Author

bradfitz commented Mar 8, 2022

As of later today, the control plane server will stop sending LastSeenChange MapResponse updates.

The Node.LastSeen field is still present, but now it doesn't update while the node's connected. It only bumps once on transition from connected to disconnected, saying that last connected seen time.

Closing this as sufficiently done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants