On Linux, and possibly other Operating Systems, Confluence's index timestamp will silently fail to be updated if it is not the owner of the file.
This seems to be a bug in Java on Linux where the File.setLastModified() method will not update the file even though the user can edit the file without problems. This means the index itself is successfully updated, but entries effectively never leave the index queue. Therefore everything gets updated every second run of index flush.
Confluence should at least report an error if the timestamp update files.
The attached diff reports the failure then attempts to remove and recreate the file. I think that's the most appropriate action.