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

ASF GitHub Bot commented on BROOKLYN-72:
----------------------------------------

Github user alasdairhodge commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/381#discussion_r21539467
  
    --- Diff: utils/common/src/main/java/brooklyn/util/os/Os.java ---
    @@ -231,13 +231,18 @@ public static DeletionResult deleteRecursively(File 
dir) {
          */
         @Beta
         public static DeletionResult deleteRecursively(File dir, boolean 
skipSafetyChecks) {
    +        if (dir==null) return new DeletionResult(null, true, null);
    +        
             try {
    -            if (dir==null) return new DeletionResult(null, true, null);
    -            
                 if (!skipSafetyChecks) checkSafe(dir);
     
                 FileUtils.deleteDirectory(dir);
                 return new DeletionResult(dir, true, null);
    +        } catch (IllegalArgumentException e) {
    +            // See exception reported in 
https://issues.apache.org/jira/browse/BROOKLYN-72
    +            // If another thread is changing the contents of the directory 
at the same time as
    +            // we delete it, then can get this exception. Try three times, 
and then give up.
    +            return new DeletionResult(dir, false, e);
    --- End diff --
    
    "Try three times"? Code above retries for one second.


> Exception when stopping Brooklyn
> --------------------------------
>
>                 Key: BROOKLYN-72
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-72
>             Project: Brooklyn
>          Issue Type: Bug
>            Reporter: Sam Corbett
>
> Brooklyn throws an unhandled IllegalArgumentException when cleaning up its 
> OSGi cache directory.
> {code}
> $ brooklyn launch
>  _                     _    _
> | |__  _ __ ___   ___ | | _| |_   _ _ __ (R)
> | '_ \| '__/ _ \ / _ \| |/ / | | | | '_ \
> | |_) | | | (_) | (_) |   <| | |_| | | | |
> |_.__/|_|  \___/ \___/|_|\_\_|\__, |_| |_|
>                               |___/             0.7.0-SNAPSHOT
> 2014-10-01 10:25:13,583 INFO  Persistence disabled
> 2014-10-01 10:25:13,587 INFO  High availability disabled
> 2014-10-01 10:25:16,701 INFO  Started Brooklyn console at 
> http://127.0.0.1:8081/, running classpath://brooklyn.war
> 2014-10-01 10:25:16,701 INFO  Launched Brooklyn; will now block until 
> shutdown issued. Shutdown via GUI or API or process interrupt.
> 2014-10-01 10:25:20,139 INFO  Web console using security provider 
> brooklyn.rest.security.provider.ExplicitUsersSecurityProvider
> 2014-10-01 10:25:20,142 INFO  Web console allowing users: [sam]
> ^C2014-10-01 10:25:42,975 INFO  terminateOnShutdown of 
> LocalManagementContext[Zzdtwojs-jZZBPTEq] returned error (continuing): 
> java.lang.IllegalArgumentException: /tmp/brooklyn-osgi-cache-fqEa/bundle18 
> does not exist
> java.lang.IllegalArgumentException: /tmp/brooklyn-osgi-cache-fqEa/bundle18 
> does not exist
>         at 
> org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1637) 
> ~[commons-io-2.4.jar:2.4]
> {code}



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

Reply via email to