Cron - Filesystem.php(430): Warning - filesize(): stat failed for [...] archive.sharedsiteids.pid #15865
Labels
not-in-changelog
For issues or pull requests that should not be included in our release changelog on matomo.org.
Hi,
There seems to be a race condition when using mutiple archiver jobs on the same node.
matomo/core/Filesystem.php
Lines 426 to 432 in 647ac56
Notice that the file is checked for existence before the filesize is checked.
Two archive jobs are started in a bash as such:
A few times a day, I get this error message for 1 of the 2 started processes:
WARNING [2020-04-27 03:39:26] 2654 /var/www/core/Filesystem.php(430): Warning - filesize(): stat failed for /var/www/tmp/climulti/archive.sharedsiteids.pid - Matomo 3.13.4
. I'm not able to forcefully reproduce it, but we know if happens a few times a day since we get a notification if a archive process exits with non-zero code.We only see this in our test environment, which has many sites but no new stats added to the sites. Run time for each archive job is <3s.
I looked through the code, and the only thing that I could spot as a potential source is this:
matomo/core/CronArchive/SharedSiteIds.php
Lines 119 to 150 in 1155273
Is there something there, where if running multiple archivers that completes in less than 5s, where this can cause issues ?
I don't have a suggestion for a fix now. Attached the output from the archive processes that runs, where one of them (b) is giving a WARNING
a.log
b.log
The text was updated successfully, but these errors were encountered: