Skip to content

protocol: stop using LastSeen so much #2107

@bradfitz

Description

@bradfitz

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions