Skip to content

feat(mount): log slow shutdown steps and dump goroutines when an unmount stalls - #101

Merged
mattmattox merged 4 commits into
mainfrom
claude/shutdown-slow-log
Nov 13, 2026
Merged

mattmattox merged 4 commits into
mainfrom
claude/shutdown-slow-log

Conversation

@mattmattox

Copy link
Copy Markdown
Contributor

Small and not urgent; the PM asked for it after the SIGTERM chase.

In one #29 Docker round, a container's mount ignored SIGTERM for 10s and nothing showed why. I couldn't reproduce it: 5 rounds on main with 139 SIGTERM stops all exited within a second, and every shutdown step took at most 11ms. So the mount now explains a stall itself:

  • A shutdown step over 2s logs shutdown: <step> took <time>. The steps covered are the API server, registry and broadcast stops, unmount, and each step inside FS.Close (snapshot worker, TRIM, journal, lock release, device close).
  • A shutdown still running after 8s logs every goroutine's stack once. Docker's default stop timeout is 10s, so the stacks are logged before Docker kills the process.

TROUBLESHOOTING.md describes both. Each of the two tests fails with its check removed.

🤖 Generated with Claude Code

mattmattox and others added 3 commits November 13, 2026 14:40
…unt stalls

One container restart in a Docker round took 27s because its mount
ignored SIGTERM for 10s, and nothing showed why. A shutdown step that
takes longer than 2s now logs its name and duration, and a shutdown still
running after 8s logs every goroutine's stack, so the next stall explains
itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	cmd/mount/main.go
#	tests/test-manifest.yaml
A busy unmount leaves the mount serving, but the watch started by the
signal still dumped every goroutine after 8s as a stalled shutdown. The
watch now ends when the unmount fails, and the next signal, or the
unmount another tool finishes, starts a new one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattmattox
mattmattox merged commit bc2280b into main Nov 13, 2026
17 checks passed
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