Repository navigation
feat: clean API shutdown, /health states and shared CLI exit codes - #97
Merged
Merged
Conversation
API shutdown: the server counts every request, closes its listener on Stop, gives requests in flight ShutdownTimeout to finish, then cancels their contexts and closes their connections, and returns only after every handler and the serve goroutine have ended. Mount stops the API before the unmount on SIGINT/SIGTERM and closes the filesystem only after the unmount, in one place; a busy unmount no longer leaves a closed filesystem mounted. /health: device (last I/O failed: unhealthy), journal (corrupt: unhealthy, recovering: degraded), recovery (replaying a crashed peer: degraded) and broadcast (send failing or no multicast and no peers: degraded). Degraded answers 200, unhealthy 503. gfsctl health decodes the 503 body. CLIs: goclusterfs-mount, goclusterfs-fsck and gfsctl share exit codes (0 ok, 8 failure, 16 usage; fsck adds 1 and 4, gfsctl health 1 and 4), error messages say what to do next, and -debug prints [DEBUG] lines in all three. Mount's [DEBUG] lines are now off by default; go-fuse tracing moved to -fuse-debug. fsck no longer exits 2 on a bad flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mattmattox
force-pushed
the
claude/api-shutdown-cli-consistency
branch
from
November 13, 2026 20:16
1a58851 to
85829bc
Compare
… match Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…li-consistency # Conflicts: # internal/goclusterfs/fs.go
…li-consistency # Conflicts: # docs/API-CONFIG.md # docs/OPERATIONS.md
…li-consistency # Conflicts: # tests/test-manifest.yaml
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…li-consistency # Conflicts: # internal/cache/broadcast/transport.go # internal/node/registry.go # internal/storage/device.go # internal/storage/device_test.go
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 13, 2026
mattmattox
added a commit
that referenced
this pull request
Nov 13, 2026
Deletes the internal/api errcheck rule and fixes the two findings in #97's lifecycle_test.go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mattmattox
added a commit
that referenced
this pull request
Nov 13, 2026
#97's test still used the old AddPeer(uuid, addr) form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mattmattox
added a commit
that referenced
this pull request
Nov 13, 2026
…116) - sfb logs container lock release failures as dir and inode do, and a container block it cannot free on rollback is now named in the error. SFB allocation is disabled, so this only matters for old images. - fileops discards close errors explicitly: it opens only read-only descriptors and gets every result from Fstat or Fsetxattr first. - Test setup in fileops and cache checks or discards errors explicitly. errcheck now covers internal/sfb and internal/fileops. internal/cache waits for cache/broadcast/transport.go, which #97 is editing. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
mattmattox
added a commit
that referenced
this pull request
Nov 13, 2026
…ges (#119) * fix(cache): bound every cache and broadcast table, with flags and gauges The broadcast peer table kept one entry per sender UUID and never dropped one, so every remount and every forged heartbeat grew it. Peers are now kept by address and, like the per-sender sequence tracking, capped at -broadcast-max-peers (256), dropping the node heard from longest ago. The inode, extent and negative caches were LRUs of fixed size, but their Go maps kept the room of evicted keys: the extent cache took 5.8 MB when full and 10.9 MB after 40 times its size went through it. Each shard now rebuilds its map after evicting as many entries as it holds. -cache-inodes, -cache-extents and -cache-negative set the cache sizes, and /metrics reports each limit plus the broadcast table sizes. The create-collision readback no longer waits through read errors other than a missing file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(broadcast): add the peer in problem_test by address #97's test still used the old AddPeer(uuid, addr) form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <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.
Behaviour changes:
goclusterfs-mount -debugnow prints the[DEBUG]lines, which are off by default. go-fuse tracing moved to-fuse-debug.gfsctl healthexits 1 when degraded (was 0) and 4 when unhealthy (was 1). fsck exits 16 on a bad flag (was 2)./healthwas alwaysok. It now reports 200degradedor 503unhealthy.Not covered: the API starts after the mount's own journal replay, so a mount that is still starting refuses connections. A busy unmount on SIGTERM keeps the mount running without its API.
🤖 Generated with Claude Code