Can you try to add a "slam protection"? Like a if (rand()<0.1) or something before locking and creating the file. Let me know if you want me to add it
Might be too many users trying to create the file and/or users accessing parts of template cache when not all files are yet created.
This is of course not a real solution but will just lower the chance it will happen...
For a real solution...m..that's tough.
An option would be to limit the creating of template files to a certain userid, and then you just browse all the pages, so the cache gets created, and only then it will be available for all users....but it's kinda hard to browse all pages. I dunno
Line 51 to:
Code:
if (rand() < 0.1 && $vbulletin->options['pbtc_seperate'] && strlen($temp['template']) > intval($vbulletin->options['pbtc_limit']) && !in_array($temp['title'], $exclude)) {
Line 75-81:
Code:
if (rand() < 0.1)
{
$fp = fopen($templatefile, 'w+');
if ($fp && flock($fp, LOCK_EX))
{
fwrite($fp, '<?php '.$cache_to_save.' ?>');
flock($fp, LOCK_UN);
fclose($fp);
}
}