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

Bjoern Pedersen bjoern.pedersen at frm2.tum.de
Fri Sep 10 10:50:13 CEST 2010


Am 10.09.2010 10:14, schrieb Helmut Hummel:
> Hi,
> 
> On 10.09.10 08:44, André Stösel wrote:
>> (See mail "RFC #8980: Bug: Prevent race conditions")
> 
> I suggest to discuss this bug here and close the other thread.
> 
>> Why replace one race condition with another?
>> We just have to use fopen(.., 'x') instead.
>>
>> So I vote -1.
> 
> I agree, that your solution is much better. I attached a cleaned up
> patch (CGL issues, made against root).
> 
> However please mind that it now behaves different, if the lockfile
> cannot be created due to wrong filepermissions or the like.
> 
> Before: It goes straight to the touch statement and an exception is thrown.
> 
> Now: It goes through the loop, trying to create the file, looping "forever".
> 
> Before: If the loop ends without the lock file beeing deleted by another
> process, the file will be "recreated" by touch.
> 
> 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?
> 
> Regards Helmut
Hi,

This fix only affects locking mode simple. I get the error also with
mode 'flock'. So both parts of the fix may be needed.

PHP Warning:
unlink(/xxx/typo3temp/locks/d89b5e8d5feaabc8f7082be1025c6769) [<a
href='function.unlink'>function.unlink</a>]: No such file or directory
in /xxx/typo3_src/t3lib/class.t3lib_lock.php line 224


Björn


More information about the TYPO3-team-core mailing list