[TYPO3-core] RFC: #8980: unlink of non existant lockfiles generates warnings in frontend
Helmut Hummel
helmut at typo3.org
Fri Sep 10 10:14:23 CEST 2010
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 8980_v3.diff
Type: text/x-patch
Size: 1217 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100910/8a09d23f/attachment.bin>
More information about the TYPO3-team-core
mailing list