Bug #97515
openfilemtime() of FileSessionHandler.php should be silent
0%
Description
Hi,
I encountered several errors like this after our own crawler runs through all pages of our intranet:
Core: Error handler (FE): PHP Warning: filemtime(): stat failed for /var/www/intranet/var/session/d7d439161737edaa72aa09938771f17c4fd208af/hash_6541a8ee794d962b4d07f99a08ba3992 in /var/www/intranet/public/typo3/sysext/install/Classes/Service/Session/FileSessionHandler.php line 184
The causing line is here:
What I found out after a lot of testing: The method reads the session hash directory and does some time comparison. Unfortunately when a lot of crawls take place in very short periods, filemtime() tries to read a hash file that is already deleted by another call of the gc(int $maxLifeTime) method.
Solution: @filemtime() instead of filemtime()
In the core, there are several places where an "@" is prepended to filemtime(), so it might be a good idea to prepend it there too. Same of course goes for other file methods that are similar.
Updated by Alexander Rotzsch over 2 years ago
Correction: ... so it might be a good idea to prepend it at other places, too.
Updated by Andreas Kienast over 2 years ago
- Sprint Focus set to On Location Sprint
Updated by Oliver Hader about 2 years ago
- Sprint Focus deleted (
On Location Sprint)
Updated by Łukasz Uznański about 1 year ago
Is muting filemtime
call a preferred solution?