SafeDisk AI

Artifact Cache Write Failure Connection Leak

When a package proxy streams an upstream response to the client and into a cache at the same time, a disk-full or S3 write failure must not leave the main request blocked until `WriteTimeout` while both client and upstream connections stay open.

Artifact cache failure check

Copy the cache-failure check before restarting the service.

Paste the ENOSPC/EDQUOT log, cache path, or handler timeout evidence and we reply with the safe first fix. The free SafeDisk AI deletion trial is only for unclear delete / confirm / protect decisions such as partial cache files, stuck connections, or shared proxy handlers.

Add command output optional

Free trial step. We reply first with a delete / confirm / protect judgment or one read-only detail we still need.

See sample result Ask AI about one file

Runbook: Cache Failure Must Not Own The Request

  1. Do not let cache persistence be a hidden hard dependency for serving an upstream artifact response.
  2. When the cache writer exits early, explicitly drain or close the cache-side reader so the tee writer does not block forever.
  3. Use `CloseWithError`, context cancellation, or equivalent signaling so the response path knows the cache side is gone.
  4. Set deadlines for cache writes and object-store puts that are shorter than the client-facing `WriteTimeout` failure mode.
  5. Test disk-full, quota-exceeded, short-write, and object-store failure paths with multiple concurrent artifact requests.
  6. Verify the error path releases client connections, upstream connections, goroutines, temp files, and file descriptors promptly.
  7. Write cache objects atomically and remove partial temp files so a failed cache write cannot poison future reads.
Copy-ready issue reply

Use this when cache-write failure blocks the streaming handler.

This keeps the fix measurable: cache failure is injected, the response path unblocks promptly, and connection pressure is bounded.

I would turn this into a cache-failure contract for every artifact handler, not just a local fix in one backend.

Acceptance checks I would add:
- Inject ENOSPC/EDQUOT or S3 PutObject failure after some bytes have already streamed.
- The client-facing handler returns promptly; it should not wait until WriteTimeout.
- The upstream response body is closed promptly on cache failure or client abort.
- The cache side drains or closes the pipe reader so the tee writer cannot block forever.
- Partial temp files are removed and never become readable cache entries.
- A concurrent test proves failing cache writes do not hold client connections, upstream connections, goroutines, or fds until timeout.
- The same behavior is covered for npm, PyPI, Cargo, Maven, and Go module handlers if they share the pattern.

Do Not Treat As A Cache Miss

Free AI deletion trial

Need a safe artifact-cache recovery order?

Submit the form first; the issue link, cache path, or failure log can follow. We check whether the free first step is enough before asking for the free SafeDisk AI deletion trial.

Add output optional

Start with email. Output can follow after the first reply.