[ 
https://issues.apache.org/jira/browse/YARN-2701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14178708#comment-14178708
 ] 

Allen Wittenauer commented on YARN-2701:
----------------------------------------


So let's summarize the current situation:

* previous code had a potential race condition. this is bad.
* reverting the code broke the portability for OSes that don't yet support the 
relatively new \*at routines.  this is equally bad, as it breaks a significant 
segment of the developer community.

There is a middle ground here that solves both of these problems:  introduce 
\*at routines as a compile-time dependency.  We should be able to detect if the 
current libc has mkdirat, opendirat, etc and, if not, compile our own in from 
sources like Free/Net/OpenBSD's implementation. 

Let's revert the revert, then build a new patch that does the above.

> Potential race condition in startLocalizer when using LinuxContainerExecutor  
> ------------------------------------------------------------------------------
>
>                 Key: YARN-2701
>                 URL: https://issues.apache.org/jira/browse/YARN-2701
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Xuan Gong
>            Assignee: Xuan Gong
>            Priority: Blocker
>             Fix For: 2.6.0
>
>         Attachments: YARN-2701.1.patch, YARN-2701.2.patch, YARN-2701.3.patch, 
> YARN-2701.4.patch, YARN-2701.5.patch, YARN-2701.6.patch
>
>
> When using LinuxContainerExecutor do startLocalizer, we are using native code 
> container-executor.c. 
> {code}
>      if (stat(npath, &sb) != 0) {
>        if (mkdir(npath, perm) != 0) {
> {code}
> We are using check and create method to create the appDir under /usercache. 
> But if there are two containers trying to do this at the same time, race 
> condition may happen.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to