NJS Body File Access Race Condition?
Lance Dockins
lance at wordkeeper.com
Sat Feb 11 03:10:23 UTC 2023
Thanks, Dmitry.
Is it correct to assume that this setting just forces all POST bodies into a file (like shutting off client body buffers)? And would that be true even with the “clean” directive?
The “clean” value sounds like it just retains the POST body file until the request completes (at which point it’s cleaned), but if that’s an incorrect understanding, please let me know.
I was sort of hoping to use memory buffers for smaller request body sizes and only use file for larger request bodies. But if this setting is the only solution to the problem (or if one of the settings is going to do what I’m describing), I’ll go with that.
--
Lance Dockins
On Feb 10, 2023 at 8:49 PM -0600, Dmitry Volyntsev <xeioex at nginx.com>, wrote:
> Hi Lance,
>
> On 10.02.2023 18:24, Lance Dockins wrote:
> > This sort of NJS behavior "seems" like some sort of race condition
> > where NJS is trying to access the file after Nginx has already
> > disposed of it. Since this is a js_content directive, it should be
> > blocking and it seems to be one of the few stages where access to the
> > POST body is even possible. So it's unclear why the client body
> > buffer file wouldn't exist at the time that this code runs.
> >
>
> Take a look at
> http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_in_file_only.
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20230210/2fbae1b6/attachment-0001.htm>
More information about the nginx
mailing list