Every disconnect counted as a failure, and the only reset sat behind a
nil return that connectAndHandle can never make. So each Pulse restart
lengthened that agent's next reconnect, up to five minutes, however long
it had been connected. For that whole wait its actions read as not
connected.
A session that stays in the message loop for a minute now restarts the
backoff when it ends. Refused and failed registrations still back off,
and so does an action runner Pulse admits but cannot activate. The rule
reads the session that just ended, because the client's admission state
stays set for its whole life.
Admission alone would not do. Pulse evicts a session when another agent
registers the same identity, so two such agents would evict each other
every 10 seconds forever, dropping the live session each time. The
minute also outlasts the first 30-second keepalive, so a connection that
dies on that ping does not count as healthy.
Measured with real binaries against a real Pulse:
Four restarts, 70 seconds apart: seconds to hold a session again
before 9, 22, 39, 78
after 10, 10, 10, 9
Two agents sharing one identity: evictions in 240 seconds
reset on any admission 23, every 10 seconds throughout
after 9, gaps widening to 73 seconds
This is agent code, so it reaches a machine only when that machine's
agent updates.
Refs #2681