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
{{ message }}
Repository navigation
error_log on Windows can hold the file write lock #8923
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).
Activity
cmb69 commentedon Jul 5, 2022
Good bug report. Thank you!
Fix phpGH-8923: error_log on Windows can hold the file write lock
Fix GH-8923: error_log on Windows can hold the file write lock
Merge branch 'PHP-8.0' into PHP-8.1
Merge branch 'PHP-8.1'