NGX error logging - Race condition possible?

Slawitscheck Stefan is151320 at fhstp.ac.at
Sun Sep 2 18:44:19 UTC 2018


Dear Development Team,
I have one question about the logging mechanism of nginx with more worker processes under Windows.
In ngx_log.c is the function ngx_write_console() which calls the systemcall WriteFile().
How is do you ensures that there is no race condition while using this function to write into the error.log file with multiple working processes?
>From my understanding, each worker process writes into the error.log file by itself. So it could be that there are two processes (worker) trying to write at the same time?So usually you need some locking, semaphore, mutex or something like that?
If you ensure that there will be no race condition, how do you guarantee it?
I am looking forward to your answer.
Kind regards,Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20180902/023cfe10/attachment.html>


More information about the nginx-devel mailing list