fix: Fixes to command stream
This commit is contained in:
@@ -382,6 +382,17 @@ func (s *vantageServer) CommandStream(stream pb.Vantage_CommandStreamServer) err
|
||||
if beats == 1 {
|
||||
log.Printf("agent %s command stream beating every %s", srv.ServerID, pingInterval)
|
||||
}
|
||||
// A beat the stream accepted is the strongest liveness evidence this
|
||||
// pod has, so it is also used to renew presence. The renewal ticker
|
||||
// proves only that a goroutine still runs; this proves the stream
|
||||
// itself still carries bytes to the agent. A false answer means
|
||||
// another pod has taken the agent over and this stream is a
|
||||
// half-open leftover, which is worth ending here rather than beating
|
||||
// into for as long as the connection survives.
|
||||
if !services.TouchPresence(ctx, srv.ServerID) {
|
||||
log.Printf("agent %s command stream superseded, closing", srv.ServerID)
|
||||
return nil
|
||||
}
|
||||
case cmd, ok := <-ch:
|
||||
if !ok {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user