Keep taking messages while a peer's session goes down (closes #216)
check / check (push) Canceled after 0s

The table's PeerDown visits every prefix under the write lock, which
takes over a second on a full table. The prefix handler called it
inline, so its queue filled and the streamer dropped updates.

PeerDown now lets the lock go after every 10,000 prefixes. The handler
runs it on a goroutine of its own, one peer at a time, and holds back
the down peer's later messages until it returns, then applies them in
order. Stop waits for this before its last flush, and logs the
held-back messages it could not apply.

Model: opus-5-5
This commit is contained in:
2026-11-02 00:18:03 +00:00
parent 38b43549b9
commit 6b02cee68b
9 changed files with 337 additions and 47 deletions
+7
View File
@@ -35,6 +35,13 @@ tested.
# Completed Steps
- 2026-11-02: a peer's session going down no longer stops the prefix handler.
The handler runs the table's `PeerDown` on a goroutine of its own, one peer at
a time, and goes on taking messages. It holds back the down peer's later
messages until its `PeerDown` returns, then applies them in order. `PeerDown`
lets the table's lock go after every 10,000 prefixes, so the IP lookup and the
pages no longer wait for the whole visit. A stop past its deadline logs the
held-back messages it did not apply (closes #216)
- 2026-10-27: the tests of `internal/routewatch` no longer fail on a loaded
host. Five of them gave `HandleMessage` two seconds to apply a full prefix
batch, which under the race detector can take longer. A test now waits up to