forked from lei.chen/myxce
fix(persist): interruptible fsync_worker sleep so persist_stop joins promptly
fsync_worker slept the full wal_sync_ms in one uninterruptible nanosleep()
before re-checking fsync_stop. persist_stop sets the flag and immediately
pthread_join()s, so the join blocked until the in-flight sleep returned —
up to a full wal_sync_ms per teardown. Tests set wal_sync_ms=5000 ("slow
fsync — no races"), so each persist_stop cost ~5s; across the ~7 suites
that use it the cumulative teardown time blew past the 300s controller-test
meson cap, killing the suite with SIGTERM.
Replace the nanosleep with pthread_cond_timedwait on a new fsync_mutex/
fsync_cond (added to persist_t, init in persist_init, destroyed in
persist_fini). persist_stop now sets fsync_stop and signals fsync_cond
under fsync_mutex before joining, so the worker wakes immediately. fdatasync
still runs under p->lock, released before re-acquiring fsync_mutex — no lock
nesting. The "commit: WAIT deadline expired" log lines were unrelated
intentional negative tests (50-300ms), not the cause.
Full controller suite now completes in ~10s (was >300s TIMEOUT); 0 failures.
Logged as bug-604.
This commit is contained in:
parent
5503c7a176
commit
8c11655e53
4 changed files with 552 additions and 414 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -1775,3 +1775,26 @@ Implemented sub-spec 3/4 of ha-consistency-invariants autonomously (per-task imp
|
|||
| 00:55 | Edited .kiro/specs/ha-prevote/tasks.md | inline fix | ~60 |
|
||||
| 00:55 | Edited .kiro/specs/ha-prevote/tasks.md | inline fix | ~68 |
|
||||
| 03:12 | ha-prevote cleanup: issue-1 log-reason fixed (47f7338); issue-2 leak deferred | .kiro/specs/ha-elect-ctx-lifecycle/, tasks.md, cerebrum.md | follow-up spec scaffolded + tracked | ~3k |
|
||||
| 00:56 | Edited CLAUDE.md | removed 40 lines | ~23 |
|
||||
| 00:56 | Session end: 21 writes across 12 files (tasks.md, test_ha_prevote.c, test_raft.c, research.md, ha.c) | 20 reads | ~57330 tok |
|
||||
| 00:56 | Edited .claude/settings.json | removed 13 lines | ~11 |
|
||||
| 00:57 | Edited .claude/settings.json | removed 13 lines | ~10 |
|
||||
|
||||
## Session: 2026-06-16 00:57
|
||||
|
||||
| Time | Action | File(s) | Outcome | ~Tokens |
|
||||
|------|--------|---------|---------|--------|
|
||||
| 00:59 | Created .mcp.json | — | ~7 |
|
||||
| 01:07 | Edited .claude/settings.json | removed 13 lines | ~11 |
|
||||
| 01:07 | Edited .claude/settings.json | removed 13 lines | ~10 |
|
||||
| 01:09 | Created .mcp.json | — | ~7 |
|
||||
| 01:09 | Created .claude/settings.json | — | ~497 |
|
||||
| 01:09 | Created uninstall-code-review-graph.sh | — | ~627 |
|
||||
| 01:10 | Session end: 6 writes across 3 files (.mcp.json, settings.json, uninstall-code-review-graph.sh) | 8 reads | ~1708 tok |
|
||||
| 01:18 | Edited src/include/persist.h | 3→5 lines | ~69 |
|
||||
| 01:18 | Edited src/controller/persist.c | 2→4 lines | ~52 |
|
||||
| 01:18 | Edited src/controller/persist.c | added 2 condition(s) | ~383 |
|
||||
| 01:18 | Edited src/controller/persist.c | 5→10 lines | ~155 |
|
||||
| 01:19 | Edited src/controller/persist.c | 4→6 lines | ~59 |
|
||||
| 15:55 | Fixed controller test timeout: interruptible fsync_worker sleep (condvar) so persist_stop joins promptly | persist.c, persist.h | suite 300s+ TIMEOUT → 10s, 0 failures | ~25k |
|
||||
| 01:23 | Session end: 11 writes across 5 files (.mcp.json, settings.json, uninstall-code-review-graph.sh, persist.h, persist.c) | 9 reads | ~2478 tok |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue