Files
pad/internal/server
xarmian a167005654 fix(server): register the stream gauge per metrics instance, and drop the comments the last refactor falsified (BUG-2726)
Codex round 11, reviewing the collector conversion:

- The registration guard was a sync.Once per Server, which is wrong in
  the direction that hides: SetMetrics can install a DIFFERENT registry,
  and the second one would silently never get
  pad_stream_connections_active. An absent metric is worse than a wrong
  one, because a dashboard with no data reads as a deployment with no
  traffic. Now tracked per metrics instance, which still cannot
  double-register (MustRegister panics) and follows a replacement.

- Two comments and a test comment still explained the deleted observer
  machinery — "the discarded gate keeps its observer, so its releases
  keep driving the gauge" — which stopped being true when that machinery
  was removed one commit earlier. The reasoning they were making still
  holds for a different reason (a replaced gate is still reachable
  through Server.admission(), so the scrape reads the new gate and looks
  plausible), so they say that instead. And heldTotal's doc still opened
  with the old name.

Falsifying your own comments while fixing something else is the failure
this diff has hit repeatedly; catching it one round later is the loop
working, not the comments being unimportant.

Claude-Session: https://claude.ai/code/session_01JVDBKbgn3Xt7ndW1YoYd8X
2026-08-22 04:01:33 +00:00
..