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.
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.
Runbook: Cache Failure Must Not Own The Request
- Do not let cache persistence be a hidden hard dependency for serving an upstream artifact response.
- When the cache writer exits early, explicitly drain or close the cache-side reader so the tee writer does not block forever.
- Use `CloseWithError`, context cancellation, or equivalent signaling so the response path knows the cache side is gone.
- Set deadlines for cache writes and object-store puts that are shorter than the client-facing `WriteTimeout` failure mode.
- Test disk-full, quota-exceeded, short-write, and object-store failure paths with multiple concurrent artifact requests.
- Verify the error path releases client connections, upstream connections, goroutines, temp files, and file descriptors promptly.
- Write cache objects atomically and remove partial temp files so a failed cache write cannot poison future reads.
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
- Cache-write errors that occur after the response has already begun streaming.
- Object-store failures that leave pipe readers, goroutines, or upstream bodies open.
- Partial cache files that can later be served as complete artifacts.
- Connection/fd growth during disk-full or quota-exceeded cache failures.
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.