Repository navigation
docs(login): #63 race explains zero confirmed prod incidents; pin the self-match reading - #1065
Merged
Merged
Conversation
… the self-match reading (#63) kth-k8s pulled the ReplicaSet history: EVERY recent prod restart carries a kubectl.kubernetes.io/restartedAt annotation, i.e. all were `kubectl rollout restart` (no bare pod delete, no OOMKill; helm history shows no upgrade since 2026-08-20). Under maxSurge=0 every one of those was no-overlap, so the handoff race cannot have caused any of them — including 09-23, which I had previously treated as the one confirmed instance. So the race now explains ZERO confirmed production incidents. The guard is still right, but it is justified as a cause-agnostic invariant keeper, not as the fix for a diagnosed outage. Claiming otherwise sends the next investigator down a path the deployment strategy already rules out. Corrected in CLAUDE.md, the store.py docstrings and the test module docstring. That left a genuine puzzle: the 09-23 pod logged "already registered and reachable (owner=...)" with no live peer available, which looked like a liveness-check false positive in #1049. It is not. _ensure_login_service_registered runs AFTER startup functions (deliberately, so a startup-registered custom login is not clobbered), so anything registering hypha-login earlier in THIS pod's own boot makes the check resolve it and ping its owner — itself, trivially alive. The skip line means "a login resolved and its owner answered", NOT "a previous generation was still live". Reproduced and pinned in test_skip_line_can_be_a_self_match: the line appears with owner equal to the pod's OWN public client id, with no second server in existence. The field discriminator is therefore to compare owner=public/<id> against the pod's own server_id from the boot log: same -> self-match; the skip was legitimate and the outage came from a LATER runtime deregistration different -> a genuine foreign owner existed, which under maxSurge=0 means something else shares the Redis and is worth hunting Note the self-match case is exactly where overwrite=True is load-bearing: the same pod's RPC peer already holds hypha-login in RPC._services. I also checked the other candidate kth-k8s raised — a stale login key from a SIGKILLed pod that the liveness ping reports reachable anyway. It did NOT reproduce: with the owning store torn down and its service keys restored into Redis, built-in resolution failed and all three fallback resolutions failed, so ping_client correctly returned "Failed to ping client ...". The fallback does contain a real latent hazard (`elif hasattr(svc, "_config"): return "pong"` reports alive without any round-trip), filed separately rather than fixed here. 9 passed (test_login_handoff_race + test_login_registration_stale_marker). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The #63 race explains zero confirmed production incidents
kth-k8s:fast-giltpulled the ReplicaSet history. Every recent prod restart carries akubectl.kubernetes.io/restartedAtannotation — allkubectl rollout restart, no bare pod delete, no OOMKill;helm historyshows no upgrade since 2026-08-20.Under
maxSurge=0every one of those was no-overlap, so the handoff race cannot have caused any of them — including 09-23, which the previous revision treated as the one confirmed instance.The guard is still right. It is justified as a cause-agnostic invariant keeper, not as the fix for a diagnosed outage. Claiming otherwise sends the next investigator down a path the deployment strategy already rules out. Corrected in
CLAUDE.md, thestore.pydocstrings, and the test module docstring.The remaining puzzle, resolved: the skip line does not prove a peer
That left something genuinely odd — the 09-23 pod logged
already registered and reachable (owner=...)with no live peer available, which looked like a liveness-check false positive in #1049.It isn't.
_ensure_login_service_registeredruns after startup functions (deliberately, so a startup-registered custom login is not clobbered). So anything that registershypha-loginearlier in this same pod's boot makes the check resolve it and ping its owner — itself, trivially alive.The skip line means "a login resolved and its owner answered", not "a previous generation was still live".
Reproduced and pinned in
test_skip_line_can_be_a_self_match: the line appears withownerequal to the pod's own public client id, with no second server in existence.Field discriminator (needs only the boot log)
Compare
owner=public/<id>against the pod's ownserver_idfromServer info: {...}:maxSurge=0means something else shares the Redis and is worth huntingThe self-match case is also exactly where
overwrite=Trueis load-bearing: the same pod's RPC peer already holdshypha-logininRPC._services.The other candidate did not reproduce
fast-giltalso proposed: a stale login key from a SIGKILLed pod (so_clear_all_server_servicesnever ran), with the liveness ping reporting it reachable anyway.I tested it — with the owning store torn down and its service keys restored into Redis, built-in resolution failed and all three fallback resolutions failed, so
ping_clientcorrectly returnedFailed to ping client .... Not the cause.The fallback does contain a real latent hazard, though:
elif hasattr(svc, "_config"): return "pong"reports a client alive without any round-trip, makingponga proof of service-entry resolvability rather than liveness for any service lackingping/echo. That underpins both #1049's login idempotency and the #15 orphan reaper. Filed separately rather than fixed here, since I could not demonstrate it firing.Tests
9 passed (
test_login_handoff_race+test_login_registration_stale_marker). Docs and one new test only — no behavior change.🤖 Generated with Claude Code