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

Shawn Heisey commented on SOLR-2739:
------------------------------------

By adding print statements to the Solr and test code, I was able to determine 
that canWrite() is always returning true.

As a further test, I wrote the following code:

{noformat}
import java.io.*;

public class Main
{
        public static void main(String[] args)
        {
                File f = new File("testfile");
                File g = new File(".");
                System.out.println("writable: " + f.canWrite());
                f.setReadOnly();
                System.out.println("writable: " + f.canWrite());
                g.setReadOnly();
                System.out.println("writable: " + f.canWrite());
        }
}
{noformat}

What this does is check canWrite on the file, then change the file to read 
only, then change the current directory to read only, printing the state of 
canWrite() after each step.

I created a directory /tmp/testfile (0x755) and created a file in that 
directory called testfile (0x644).  While in /tmp/testfile, I ran the above 
program.  When it's done both the directory and the file have no write 
permissions, with this output:

writable: true
writable: true
writable: true

Running it multiple times produces the same output.  This is looking to me like 
a bug in java, one that seems to have been there for quite a while.  I got the 
same results on our production webserver (CentOS5 with java 1.6.0_14).


> TestSqlEntityProcessorDelta.testNonWritablePersistFile failures on some 
> systems
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-2739
>                 URL: https://issues.apache.org/jira/browse/SOLR-2739
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 3.3
>            Reporter: Shawn Heisey
>            Assignee: Hoss Man
>             Fix For: 3.5, 4.0
>
>
> Shawn Heisey noted on the mailing list that he was getting consistent 
> failures from TestSqlEntityProcessorDelta.testNonWritablePersistFile on his 
> machine.
> I can't reproduce his exact failures, but the test is hinky enough that i 
> want to try and clean it up.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to