diff --git a/agent/agent.go b/agent/agent.go index 586a1785e8515..146cc936cd179 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -801,7 +801,9 @@ func (r *reconnectingPTY) Close() { _ = conn.Close() } _ = r.ptty.Close() + r.circularBufferMutex.Lock() r.circularBuffer.Reset() + r.circularBufferMutex.Unlock() r.timeout.Stop() }