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

Dawid Weiss commented on SOLR-6119:
-----------------------------------

> Revision 1598013 changed the logic in the finally block by trying to delete 
> snapDir instead of each of the directories.

This isn't true? The change I introduced still attempted to remove all of the 
dirs because snapDir is/was an array. In fact, this is not really correct in 
the patch:
{code}
+      for (File dir : snapDirs) if(dir !=null) {
+        TestUtil.rm(dir);
       }
{code}
because the first failure will cause an IOException and cause any remaining 
folders not to be considered for deletion (that's why I changed it in the first 
place).

> Fixed 2 logical mistakes in the test

What were the logical mistakes in this test?

> TestReplicationHandler attempts to remove open folders
> ------------------------------------------------------
>
>                 Key: SOLR-6119
>                 URL: https://issues.apache.org/jira/browse/SOLR-6119
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Dawid Weiss
>            Priority: Minor
>         Attachments: SOLR-6119.patch
>
>
> TestReplicationHandler has a weird logic around the 'snapDir' variable. It 
> attempts to remove snapshot folders, even though they're not closed yet. My 
> recent patch uncovered the bug but I don't know how to fix it cleanly -- the 
> test itself seems to be very fragile (for example I don't understand the 
> 'namedBackup' variable which is always set to true, yet there are 
> conditionals around it).



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to