diff src/core/ngx_log.c @ 9296:af5b47569cb2

Core: fixed ENOSPC handling for error logs. For each connection a new ngx_log_t structure is created, and saving anything into disk_full_time field in this structure doesn't affect other connections. Fix is to move the disk_full_time field into the ngx_open_file_t structure.
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 25 Jun 2024 22:57:57 +0300
parents f18db38a9826
children e1f15d47d102
line wrap: on
line diff
--- a/src/core/ngx_log.c
+++ b/src/core/ngx_log.c
@@ -169,7 +169,7 @@ ngx_log_error_core(ngx_uint_t level, ngx
             goto next;
         }
 
-        if (ngx_time() == log->disk_full_time) {
+        if (ngx_time() == log->file->disk_full_time) {
 
             /*
              * on FreeBSD writing to a full filesystem with enabled softupdates
@@ -183,7 +183,7 @@ ngx_log_error_core(ngx_uint_t level, ngx
         n = ngx_write_fd(log->file->fd, errstr, p - errstr);
 
         if (n == -1 && ngx_errno == NGX_ENOSPC) {
-            log->disk_full_time = ngx_time();
+            log->file->disk_full_time = ngx_time();
         }
 
         if (log->file->fd == ngx_stderr) {