|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71120 File change notification fails after uploading a file
Submitted: 2015-12-14 20:06 UTC Modified: 2020-08-12 21:57 UTC
Avg. Score:3.7 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:2 (66.7%)
From: julientld at free dot fr Assigned:
Status: Wont fix Package: WinCache (PECL)
PHP Version: 7.0.0 OS: Windows Server 2012
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-12-14 20:06 UTC] julientld at free dot fr

In 2010, I reported on the IIS forum a bug in the WinCache 1.1 extension on an IIS 6.0 + PHP 5.3 server. The bug is still present in WinCache 2.0 + PHP 7.0 so I open now a ticket :) The bug affects more precisely the file change notification mechanism.

Sometimes (randomly and not reproductible), when I upload a PHP file with an FTP client software like FileZilla or the FTP plugin embedded in Notepad++, the new file is not taken into account and the server processes yet the old file stored in the WinCache file cache.

However, the new uploaded file is the right on the server hard disk.

Most of the time (90% of the uploads), the file change notification (fcndetect = 1) mechanism works very well.

I have had yet this bug this week. After verification in the wincache.php (File System Cache tab), the Add time column displays the TTL of the old file (a very long time) confirming the new file has not been refreshed.

FYI, the use of the wincache_refresh_if_changed() function doesn't permit to load the new file. Old file is still used by IIS. The solution is to reupload the file (sometimes multiple times), delete it and reupload, stop/start IIS or make a change in the file from the server explorer.

I upload just one file at the same time.

I use IIS 8.0, PHP 7.0.0 NTS x64, WinCache

Cache Settings

wincache.chkinterval 0
wincache.enablecli 1
wincache.fcachesize 16
wincache.fcenabled 1
wincache.fcndetect 1
wincache.filecount 4096
wincache.filemapdir D:\Temp\php\wincache\
wincache.ignorelist test.php
wincache.maxfilesize 256
wincache.reroute_enabled 0
wincache.scachesize 16
wincache.ttlmax 0
wincache.ucachesize 64
wincache.ucenabled 0

My file cache is used at 5 % and hits are 99,8 %. Here the details :

File Cache Overview

Cache uptime 77 hours 4 minutes 32 seconds
Cached files 124
Total files size 823.82 kB
Hits 175947
Misses 387
Total memory 16 MB
Available memory 15.14 MB
Memory overhead 12.34 kB

It is not a major bug but it is pretty boring because, sometimes, I believe new code has been taken into account and in fact no...

Hope, the MS team will have the time to fix this.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-12-15 17:36 UTC]
-Assigned To: +Assigned To: ericsten
 [2015-12-15 17:36 UTC]
// TODO: Handle ERROR_NOTIFY_ENUM_DIR - change buffer overflowed & we
        // TODO: missed some changes.
        // TODO: Not sure what to do here, since we don't have a mechanism for
        // TODO: invalidating a directory and all files under the directory.
        // TODO: The aplist cache is only designed to lookup full paths. Any
        // TODO: other enumeration would be an O(1) traversal of the cache.

1. Add tracing to monitor when the file change notify code hits ERROR_NOTIFY_ENUM_DIR condition
2. Handle the ERROR_NOTIFY_ENUM_DIR condition correctly by re-enumerating the directory, and marking any items in the cache from that directory as modified. Extra Credit: Only mark the changed files as changed, and leave the unchanged files alone.
 [2020-08-12 21:57 UTC]
-Status: Assigned +Status: Wont fix -Assigned To: ericsten +Assigned To: -Block user comment: No +Block user comment: Yes
 [2020-08-12 21:57 UTC]
Won't Fix-ing all old bugs.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Jul 02 18:03:35 2022 UTC