[TYPO3-core] RFC: #8980: unlink of non existant lockfiles generates warnings in frontend

André Stösel andre at stoesel.de
Fri Sep 10 10:59:41 CEST 2010


> Now: If there is is a stale lockfile because another process died
> after creating and before releasing the lock an exception is thrown,
> resulting in the page beeing inaccessible until the stale lockfile
> beeing manualy deleted. I think this is a showstopper. Any idea how
> to handle this case?

Maybe we should check the lockfiles ctime if we can't aquire the lock
in order to detect stale lock files. Of course this adds another
race possibilty if two processes try to remove the stale lock at the
same time, but in this case we can safely ignore any errors of the
unlink() call (IOW use @unlink). I think if the files ctime is older
than 120 seconds it is safe to assume that it is a stale lockfile.

Anyway the fopen(..., "x") prevents the possibility that two (or more)
processes aquire the same lock at the same time, so I really think its
worth it.


More information about the TYPO3-team-core mailing list