[TYPO3-core] RFC #8980: Bug: Prevent race conditions

André Stösel andre at stoesel.de
Thu Sep 9 16:53:10 CEST 2010


This is an SVN patch request.

Type: Bugfix

Bugtracker references: http://bugs.typo3.org/view.php?id=8980

Branches: "TYPO3_4-4 & trunk"

Problem:
There is a race condition when acquiring the lock.
In the time between is_file() returning False and touch creating the
lock another process does the same. In the end two processes try to
unlink the lockfile (beside the fact that whatever uses the lock isn't
protected against parallel access).

Solution:
Use fopen('x') instead of is_file & touch.

Notes:
This patch is a modified version of the patch which was added by Andy
Kittner. I have it running this way successfully for more than a year.
(Old bug, new patch.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug_8980.diff
Type: text/x-patch
Size: 1661 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100909/b7f2b9b8/attachment.bin>


More information about the TYPO3-team-core mailing list