You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem can only be seen on a very busy Windows box. If error_log is called then the lock is not immediately released by the file close but at a time that "depends upon available system resources". This is a 'feature' of the Windows function LockFileEx. The problem has already been addressed in the routine ps_files_close (in the file mod_files.c):
static void ps_files_close(ps_files *data)
{
if (data->fd != -1) {
#ifdef PHP_WIN32
/* On Win32 locked files that are closed without being explicitly unlocked
will be unlocked only when "system resources become available". */
flock(data->fd, LOCK_UN);
#endif
close(data->fd);
data->fd = -1;
}
}
The same logic should be implemented in the routine php_log_err_with_severity (in main.c).
PHP Version
All versions
Operating System
Windows
The text was updated successfully, but these errors were encountered:
On Windows, closing a file which is locked may not immediately remove
the lock. The `LockFileEx()` documentation states:
| Therefore, it is recommended that your process explicitly unlock all
| files it has locked when it terminates.
We comply, and also use the macro `LOCK_EX` instead of the magic number
`2`.
cmb69
linked a pull request
Jul 5, 2022
that will
close
this issue
Description
The problem can only be seen on a very busy Windows box. If error_log is called then the lock is not immediately released by the file close but at a time that "depends upon available system resources". This is a 'feature' of the Windows function LockFileEx. The problem has already been addressed in the routine ps_files_close (in the file mod_files.c):
The same logic should be implemented in the routine php_log_err_with_severity (in main.c).
PHP Version
All versions
Operating System
Windows
The text was updated successfully, but these errors were encountered: