The buglog was one 27K-line JSON file whose fields covered only symptom,
root cause and fix, as free text: 2% of entries named the code version a
bug was found on, 12% the build profile, 36% a way to reproduce, and 58% of
the file was OpenWolf hook auto-detections ("Missing guard clause",
"Function not marked async" on .md files).
- .claude/skills/buglog/bug-record.md: the record standard. Eight
sections (Summary as the title, Description, Environment, Reproduction;
Root cause, Fix, Verification, References once fixed), each with the
content it must contain -- e.g. Environment needs the OS, the libc the
failing binary loads (from its ELF interpreter: glibc 2.42 in the nix
shell vs 2.40 on the host), toolchain, build profile and commit.
- .wolf/bugs/<id>.md: 500 records migrated from buglog.json; every field
verified to round-trip. They carry legacy: true and an explicit "not
recorded" where the old log had no such field; component derived from
file paths, severity from keywords (else unknown), fix_commits from
hashes in status_note/fix that git resolves (91 of 463 fixed).
- .wolf/buglog-archive.json: the 710 hook auto-detections, verbatim.
- .wolf/buglog.json is now an index generated from the records, keeping
the fields OpenWolf's hooks and `openwolf bug search` read.
- scripts/buglog.py rewritten: new (template + Environment collected from
the machine and --binary), check, status (refuses a status the record
doesn't support; fixed needs Root cause, Fix, Verification and
--commit hashes git resolves), note, recur, set, show, list, triage,
env, index. 29 unittest cases in scripts/tests/test_buglog.py.
- scripts/git-hooks/pre-commit runs `check --staged`: incomplete staged
records, a legacy record hand-changed to fixed without the fix-time
sections, a new record claiming legacy: true, or a stale index refuse
the commit.
- scripts/gitea-sync.py reads the records: issue body = the record's
sections plus linked fix commits (origin remote, GITEA_COMMIT_REPO to
override), and a body hash so an issue's text is refreshed when the
record changes.
- bug-1866 rewritten to the full standard as the worked example.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
39 lines
4.7 KiB
Markdown
39 lines
4.7 KiB
Markdown
---
|
|
id: "bug-1728"
|
|
status: "fixed"
|
|
status_updated: "2026-09-27"
|
|
status_note: "33c4f28c: failed join barrier unbinds w->ep (was dangling); idx -1 teardown now WARN"
|
|
component: "controller"
|
|
severity: "unknown"
|
|
timestamp: "2026-08-28T10:25:14Z"
|
|
last_seen: "2026-09-19T09:00:00Z"
|
|
occurrences: 3
|
|
files: ["src/controller/cluster.c (handle_endpoint_error", "~line 52-77); src/controller/worker.c or join.c (handle_worker_join", "commit-barrier caller -- not yet located)"]
|
|
tags: ["controller", "ha", "logging-severity", "false-error", "worker-join", "commit-barrier", "found-live", "session-sibling-of-bug-1727"]
|
|
related: ["bug-1727"]
|
|
fix_commits: ["33c4f28c"]
|
|
legacy: true
|
|
---
|
|
|
|
# bug-1728: Controller logs `ERROR [handle_endpoint_error] incorrect worker idx -1` in all 3 nodes of a live…
|
|
|
|
## Description
|
|
Controller logs `ERROR [handle_endpoint_error] incorrect worker idx -1` in all 3 nodes of a live HA cluster (ctrl-1.log, ctrl-2.log, ctrl-3.log), always immediately after the same two-line sequence: `WARN [commit_submit] commit: WAIT deadline expired without commit (lsn=X committed_lsn=Y writable_lsn=1 timeout_ms=500)` then `WARN [handle_worker_join] handle_worker_join commit barrier failed for pc13v, rc -110`. All three occurrences in the sampled log correlate exactly with an in-progress PreVote/failover window (liveness poll timeout -> primary_ctrl_fd RDHUP -> PreVote begin, immediately preceding each ERROR).
|
|
|
|
## Environment
|
|
_Not recorded (migrated from buglog.json)._
|
|
|
|
## Reproduction
|
|
_Not recorded (migrated from buglog.json)._
|
|
|
|
## Root cause
|
|
NOT FIXED -- recorded for future investigation. Read handle_endpoint_error() (cluster.c:52-119): on any endpoint teardown/error, it inspects priv->role; for HostRole_worker it branches on priv->u.idx -- if >=0, calls handle_worker_leave(c, idx) (the normal, silent teardown path); if <0 (the sentinel for 'never finished joining'), it logs ERROR('incorrect worker idx %d', priv->u.idx) instead (cluster.c:75). Working hypothesis (not yet confirmed by reading handle_worker_join() itself): a worker's endpoint gets `priv->u.idx` assigned only once its join fully completes; the commit barrier inside handle_worker_join() is what actually blocks that completion, and it just failed (rc -110 = -ETIMEDOUT) because quorum was mid-PreVote-failover and couldn't ack the WAL entry within the fixed 500ms commit_submit deadline (already WARNed one line above, correctly). So the worker's join never finishes, its endpoint's idx sentinel never advances off -1, and when that half-joined endpoint then errors out (e.g. the join's own failure path tearing the connection down, or the worker retrying), handle_endpoint_error() sees role==worker && idx==-1 and logs it as a hard, unexplained ERROR -- even though it is the direct, already-WARNed consequence of the commit-barrier timeout two lines above, not a new/distinct fault. Same shape as bug-1727's session sibling finding for scheduler sched_init_resources() and the worker kill-job ERROR-logging issue: an expected, self-healing HA-transition condition (worker retries the join once quorum stabilizes -- confirmed later in the same logs by 'HA quorum restored') surfacing as an unexplained hard ERROR instead of being correlated with the WARN that actually explains it. NOT YET CONFIRMED: have not read handle_worker_join()'s own body (location not pinned down -- likely worker.c or join.c) to verify priv->u.idx really stays -1 specifically because of THIS commit-barrier failure path (vs. some other reason), nor traced exactly what tears the endpoint down afterward to trigger handle_endpoint_error().
|
|
|
|
## Fix
|
|
NOT FIXED -- recorded for future investigation only, no code change made. Next steps: (1) locate and read handle_worker_join()'s full body to confirm priv->u.idx is left at -1 specifically on the commit-barrier-timeout path (rc -110) and identify what closes/errors the endpoint afterward; (2) if confirmed, either (a) downgrade cluster.c:75's ERROR to WARN with a message that explicitly references the join-in-progress/commit-barrier-timeout context (avoids the unexplained-hard-ERROR read), or (b) have the commit-barrier-timeout failure path in handle_worker_join() itself suppress/mark the endpoint so handle_endpoint_error() can recognize 'this was a known, already-logged join failure' and skip the redundant ERROR entirely; (3) verify against a live 3-node HA soak (xce-test-ha) that downgrading doesn't hide a genuinely-different idx<0 cause (e.g. a real accounting bug elsewhere assigning idx incorrectly) -- keep ERROR (or WARN-with-detail) for any idx<-1 or any case NOT immediately preceded by a commit-barrier-timeout WARN for the same worker, so a genuinely new failure mode doesn't get silently swallowed by too broad a downgrade.
|
|
|
|
## Verification
|
|
_Not recorded (migrated from buglog.json)._
|
|
|
|
## References
|
|
- Related: bug-1727
|