Project

General

Profile

Actions

Bug #97515

open

filemtime() of FileSessionHandler.php should be silent

Added by Alexander Rotzsch almost 2 years ago. Updated 7 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2022-04-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:
Stabilization Sprint

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:

https://github.com/TYPO3/typo3/blob/bbc8676ba09c058d7b6f6d595e5931333f48b993/typo3/sysext/install/Classes/Service/Session/FileSessionHandler.php#L184

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.

https://www.php.net/manual/de/function.filemtime.php

Actions #1

Updated by Alexander Rotzsch almost 2 years ago

Correction: ... so it might be a good idea to prepend it at other places, too.

Actions #2

Updated by Andreas Kienast over 1 year ago

  • Sprint Focus set to On Location Sprint
Actions #3

Updated by Oliver Hader over 1 year ago

  • Sprint Focus deleted (On Location Sprint)
Actions #4

Updated by Benni Mack 11 months ago

  • Sprint Focus set to Stabilization Sprint
Actions #5

Updated by Łukasz Uznański 7 months ago

Is muting filemtime call a preferred solution?

Actions

Also available in: Atom PDF