[TYPO3-core] Could not acquire lock for ClassLoader cache creation

Markus Klein klein.t3 at mfc-linz.at
Wed May 7 22:19:29 CEST 2014


Hi!

> >
> > Brian Lynch wrote:
> >
> >> Any thoughts on this?
> > Well, this is how simple locking works. There is an empty file created
> > to notice further processes that a critical operation is in progress.
> > After that, the file should be deleted. Then the next process can take
> > the lock and do a critical operation.
> >
> > The questions is why the file is not deleted.
> >
> Perhaps PHP execution time is limited to 30 secs and the process dies before
> it can delete the file.
> This would indicate that there is a feature missing after which time an other
> process would get the lock...

Actually this feature is present for ages and looks like this:

if (file_exists($this->resource)) {
	$this->sysLog('Waiting for a different process to release the lock');
	$maxExecutionTime = (int)ini_get('max_execution_time');
	$maxAge = time() - ($maxExecutionTime ?: 120);
	if (@filectime($this->resource) < $maxAge) {
		@unlink($this->resource);
		$this->sysLog('Unlinking stale lockfile');
	}
}

So there is something wrong with the file. Either the filectime() is incorrect (which I rather doubt) or the unlink() does not work.

I suggest to go into this file: typo3/sysext/core/Classes/Locking/Locker.php
Line 275: Remove the @ there and watch the error log and/or the output.

Kind regards
Markus

------------------------------------------------------------
Markus Klein
TYPO3 CMS Active Contributors Team Member




More information about the TYPO3-team-core mailing list