Req #35326 [Nab]: Concurrency issue with recursive mkdir

From: Date: Wed, 30 Oct 2013 08:49:25 +0000
Subject: Req #35326 [Nab]: Concurrency issue with recursive mkdir
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182488@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=35326&edit=1

 ID:                 35326
 User updated by:    bugs dot php dot net at chsc dot dk
 Reported by:        bugs dot php dot net at chsc dot dk
 Summary:            Concurrency issue with recursive mkdir
 Status:             Not a bug
 Type:               Feature/Change Request
 Package:            *General Issues
 Operating System:   Linux
 PHP Version:        5.1.6
 Block user comment: N
 Private report:     N

 New Comment:

> To create the right locking mechanism to avoid such issue to happen

We don't need a locking mechanism. If the creation of a directory fails, we just need to check
if it exists anyway (i.e. it has been created by a concurrent thread). If it does, we can proceed to
create the subdirectories.


Previous Comments:
------------------------------------------------------------------------
[2013-10-01 04:52:05] pajoye@php.net

Update the status.

And adding a small note about "why is it not a php bug", what is described here 
can happen anywhere outside php as well, be a shell script, ftp/ssh, etc.

------------------------------------------------------------------------
[2013-10-01 04:21:25] pajoye@php.net

Should have been:

... and will drastically affect performance without actually solving the 
problem....

------------------------------------------------------------------------
[2013-10-01 04:15:57] pajoye@php.net

I am not sure it is actually a PHP problem. To create the right locking mechanism 
to avoid such issue to happen between (almost) simultaneous requests is the 
application developer job, not the core.

Adding such tests should be done in almost all file creation operations (and some 
other) and will drastically performance without actually solving the problem.

------------------------------------------------------------------------
[2013-09-30 10:39:45] me at vlastv dot ru

Problem still exists in PHP 5.4.1.

------------------------------------------------------------------------
[2013-07-23 22:55:07] gustavo dot straube at gmail dot com

Problem still exists in PHP 5.3.3.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=35326


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=35326&edit=1


Thread (12 messages)

« previous php.bugs (#182488) next »