Bug #74268 [Com]: Opcache fails to detect directory symlink changes
| From: | jake at qzdesign dot co dot uk | Date: | Tue, 11 Jan 2022 23:23:58 +0000 |
| Subject: | Bug #74268 [Com]: Opcache fails to detect directory symlink changes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-238978@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74268&edit=1
ID: 74268
Comment by: jake at qzdesign dot co dot uk
Reported by: marshall at ahoy dot com
Summary: Opcache fails to detect directory symlink changes
Status: Open
Type: Bug
Package: opcache
Operating System: Linux Ubuntu 16.04.2 LTS
PHP Version: 7.1.3
Block user comment: N
Private report: N
New Comment:
touching or updating the file in either the old or the new symlink does not resolve the
issue - it can even be seen that code newly added into the old symlink gets executed.
Adding opcache_reset() into the code in the old symlink does however resolve the issue
for the next page load - thus showing that the issue is with OPcache.
(PHP 7.3.33 LiteSpeed V7.9 Cloudlinux 1.3)
Previous Comments:
------------------------------------------------------------------------
[2021-10-07 10:06:08] cmb@php.net
Related To: Bug #77175
------------------------------------------------------------------------
[2017-03-17 21:07:43] marshall at ahoy dot com
Description:
------------
When a directory symlink is changed to a new target directory and the new target contains file names
that were also in the old target directory, OPcache sometimes returns the old file instead of the
new file.
lrwxrwxrwx 1 root root 2 Mar 17 20:28 v -> v1
-rw-r--r-- 1 root root 60 Mar 17 20:22 test.php
drwxr-xr-x 2 root root 4096 Mar 17 20:22 v2
drwxr-xr-x 2 root root 4096 Mar 17 20:21 v1
Both v1 and v2 contain home.php with different contents
Changing the symlink v from v1 to v2 does not always cause the desired result. Sometimes OPcache
alternates between the two different home.php pages.
Using FPM/FastCGI with PHP Version 7.1.3-2+deb.sury.org~xenial+1
Same problem using PHP Version 7.0.15
Test script:
---------------
test.php:
<?php
echo "This is test.php\n";
include("v/home.php");
?>
v1/home.php:
<?php
echo "This is v1/home.php\n";
v2/home.php:
<?php
echo "This is v2/home.php\n";
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74268&edit=1