Skip to content

chore: codebase audit, graceful shutdown, doc cleanup - #36

Merged
kacy merged 1 commit into
mainfrom
chore/phase4-audit-and-docs
Feb 6, 2026
Merged

chore: codebase audit, graceful shutdown, doc cleanup#36
kacy merged 1 commit into
mainfrom
chore/phase4-audit-and-docs

Conversation

@kacy

@kacy kacy commented Feb 6, 2026

Copy link
Copy Markdown
Owner

summary

full codebase audit across all 6 crates (ember-server, ember-core, ember-protocol, ember-persistence, ember-cluster, ember-cli). 574 tests pass, clippy clean, zero doc warnings.

fixes from the audit:

  • added graceful shutdown to the server — stops accepting connections on SIGINT/SIGTERM and drains active handlers before exiting (critical gap identified in audit)
  • added fsync after AOF truncate header rewrite to ensure durability on crash-after-rewrite
  • fixed all 56+ rustdoc warnings from unescaped angle brackets and square brackets in command doc comments
  • fixed clippy range check style warnings in test assertions

documentation updates:

  • updated all 6 crate READMEs to reflect the current feature set (hashes, sets, cluster commands were missing from ember-protocol; types incomplete in ember-core; graceful shutdown added to ember-server)
  • removed stale "WIP" labels from cluster crate references

what was tested

  • cargo test --workspace — 574 tests pass, 0 failures
  • cargo clippy --workspace -- -D warnings — zero warnings
  • cargo doc --workspace --no-deps — zero warnings (was 30+)
  • cargo fmt --all --check — clean

design considerations

graceful shutdown: uses tokio::select! with biased to prioritize the shutdown signal over new accepts. drains by acquiring all semaphore permits (each connection releases its permit on exit). simple, no new dependencies, no broadcast channels needed.

AOF truncate fsync: the truncate method now calls sync_all() after flushing the fresh header. this closes a durability window where a crash between truncate and the next write could leave an unsynced header on disk.

doc comment style: switched from <angle> syntax (interpreted as HTML) to `backtick` syntax for parameters and \[escaped\] for optional flags. consistent across all 62 commands.

- add graceful shutdown on SIGINT/SIGTERM with connection draining
- fix all rustdoc warnings (escape angle brackets and square brackets
  in command doc comments across 56 doc strings)
- fix clippy range check warnings in test assertions
- add fsync after AOF truncate header rewrite for durability
- update all crate READMEs to reflect current feature set
  (hashes, sets, cluster commands, graceful shutdown)
- remove stale "WIP" labels from related crate tables
- update CLAUDE.md command count from 49 to 62
@kacy
kacy merged commit 62ccec9 into main Feb 6, 2026
5 checks passed
@kacy
kacy deleted the chore/phase4-audit-and-docs branch February 7, 2026 20:06
kacy added a commit that referenced this pull request Feb 11, 2026
chore: codebase audit, graceful shutdown, doc cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant