Files
Johnathan Corgan 4990525b62 fix(peering): do not count a failed heartbeat send as a delivered one
The heartbeat was recorded as sent before the send was attempted, so a peer
whose heartbeat could not go out was treated as heartbeated and was not tried
again for a whole heartbeat_interval_secs, although it had heard nothing and
its own link-dead timer was running.

Record the attempt and the delivery separately. The interval that paces a
healthy peer now advances only on a send that returned cleanly, and a peer
whose send failed is retried after a shorter fixed interval instead of after a
full heartbeat interval.

The retry interval gates only a peer whose last attempt failed. On a healthy
peer the two timestamps are equal, so consulting it there would clamp a
heartbeat_interval_secs configured below the retry interval, and that setting
has no validation floor.

The due-or-not decision moves into a small pure function so it can be tested
without driving a send. The tests cover both halves and both were checked
against the defect rather than only against the fix: restoring the old ordering
fails the integration test on the recorded-as-landed assertion, and removing
the retry gate fails it on the not-retried-every-tick assertion.

Also widen the generated-config ignore glob. The rule matched
generated-configs/ exactly, while the scripts write
generated-configs${FIPS_CI_NAME_SUFFIX}, so every suffixed run left an
untracked directory behind.
2026-09-09 00:17:09 +00:00

19 lines
349 B
Plaintext

# Staged binaries (copied from target/release/ for test runs)
fips
fipsctl
fipstop
fips-gateway
# Generated test configs. The suffixed form is what a run with
# FIPS_CI_NAME_SUFFIX set writes, so the glob has to cover both.
generated-configs*/
# Simulation results
sim-results/
# Python caches
__pycache__/
# Staged binary directory
static/bin/