[PATCH] Do not break downstream connection on proxy_cache write error

Kipras kiprasm at gmail.com
Mon May 2 13:51:20 UTC 2022

Hi all, this is the first time i'm submitting a patch for Nginx, i hope i'm
doing this correctly, apologies if not :)
(i want to provide some context behind the patch, so i'm following up the
patch with a message sent directly to the group, using the same topic, hope
it will end up in the right thread)

This is a fix for: https://trac.nginx.org/nginx/ticket/1945

In short: when HTTP proxy_pass is used with proxy_cache and while writing
the response to the cache the write fails (for example target disk is full)
- Nginx closes the downstream connection (the response breaks).

With this change, in this situation (when a cache write fails):
* the downstream connection is not closed (response continues to be sent
from upstream to the client)
* Nginx stops attempting to write this response to the cache
* Nginx deletes the temporary cache file after the response is fully served
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20220502/9e7a2c47/attachment.htm>

More information about the nginx-devel mailing list