Repository navigation
metadata: bound content store calls during garbage collection - #14016
salman-frs wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR bounds metadata content-store garbage collection’s backend calls with a configurable timeout to prevent daemon-wide stalls when a proxied content store hangs while cs.l is held, aligning with the failure mode described in #14010.
Changes:
- Adds a new timeout key (
io.containerd.timeout.gc.content.cleanup) with a 30-minute default and applies it to the full content GC backend pass. - Updates the configuration manpage to document the new timeout.
- Adds a regression test that simulates a hanging backend
Deleteand verifies GC exits via deadline.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| docs/man/containerd-config.toml.5.md | Documents the new content GC cleanup timeout key and default. |
| core/metadata/content.go | Registers the default timeout and wraps backend GC calls with timeout.WithContext. |
| core/metadata/content_test.go | Adds a synctest-backed unit test covering a hanging backend delete during GC. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
29bb5c1 to
ff98d94
Compare
ff98d94 to
536c4cb
Compare
536c4cb to
b7d234d
Compare
`contentStore.garbageCollect` holds `cs.l` while calling the backing content store. Since `DB.cleanupContent` strips cancellation, a stalled proxy can hold the lock forever and block every content operation. Apply a 30-minute timeout to the backing store calls. The timeout covers the whole pass rather than each deletion, so the lock hold has one upper bound. The next GC pass retries any unfinished cleanup. Fixes: containerd#14010 Signed-off-by: salman-frs <[email protected]>
b7d234d to
db32a7e
Compare
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Heads up: #14187 puts the timeout in the proxy client as an optional default_timeout, following @fuweid's suggestion in #14026. It covers the snapshot proxy only, so the content side still needs its own key because Writer outlives the call that created it. Leaving it to the maintainers whether that replaces the per-component approach here. |
contentStore.garbageCollectholdscs.lwhile calling the backing contentstore. Since
DB.cleanupContentstrips cancellation, a stalled proxy can holdthe lock forever and block every content operation.
Apply a 30-minute timeout to the backing store calls. The timeout covers the
whole pass rather than each deletion, so the lock hold has one upper bound. The
next GC pass retries any unfinished cleanup.
Fixes: #14010