Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-973

FileSystemConnector behaves strangely on NFS

    Details

      Description

      Some of FileSystemConnector tests are failing on NFS drive.

      Several tests are failing
      Example
      <testcase classname="org.modeshape.connector.filesystem.FileSystemConnectorWritableTest" name="shouldBeAbleToCreateFileWithContent" time="3.818">
      <failure type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError:
      at org.modeshape.connector.filesystem.FileSystemConnectorWritableTest.assertContents(FileSystemConnectorWritableTest.java:598)
      at org.modeshape.connector.filesystem.FileSystemConnectorWritableTest.shouldBeAbleToCreateFileWithContent(FileSystemConnectorWritableTest.java:135)
      </failure>
      </testcase>

      Moreover an exception is printed to standard error
      org.modeshape.graph.connector.RepositorySourceException: Error moving temporary data file to path "/tmp/modeshape5274288099061789508.tmp to /qa/services/hudson/hudson_workspace/workspace/soa-modeshape-single/modeshape/extensions/modeshape-connector-filesystem/target/repositories/test/testFile" in workspace "test" in Test Repository
      at org.modeshape.connector.filesystem.FileSystemWorkspace.putNode(FileSystemWorkspace.java:309)
      at org.modeshape.graph.connector.base.PathWorkspace$PutCommand.apply(PathWorkspace.java:270)
      at org.modeshape.graph.connector.base.PathWorkspace.commit(PathWorkspace.java:204)
      at org.modeshape.graph.connector.base.PathTransaction$WorkspaceChanges.commit(PathTransaction.java:896)
      at org.modeshape.graph.connector.base.PathTransaction.commit(PathTransaction.java:787)
      at org.modeshape.graph.connector.base.Connection.execute(Connection.java:130)
      at org.modeshape.graph.Graph.execute(Graph.java:283)
      at org.modeshape.graph.Graph$5.process(Graph.java:226)
      at org.modeshape.graph.request.RequestBuilder.createNode(RequestBuilder.java:289)
      at org.modeshape.graph.Graph$13.submit(Graph.java:1342)
      at org.modeshape.graph.Graph$13.submit(Graph.java:1335)
      at org.modeshape.graph.Graph$CreateAction.and(Graph.java:7995)

      I have tweaked FileSystemWorkspace source code a little bit and I have found that in method putNode there is a condition
      if (!temp.renameTo(parentFile)) {
      that is evaluated to true. I have added an information lines to be printed in the condition
      System.err.println("UPDATE ERROR " + temp.getCanonicalPath() + " " + parentFile.getCanonicalPath());
      System.err.println("UPDATE " + temp.exists());
      System.err.println("UPDATE " + parentFile.exists());
      System.err.println("UPDATE " + parentFile.getParentFile().exists());

      Which gives me result
      UPDATE ERROR /tmp/modeshape5274288099061789508.tmp /qa/services/hudson/hudson_workspace/workspace/soa-modeshape-single/modeshape/extensions/modeshape-connector-filesystem/target/repositories/test/testFile
      UPDATE true
      UPDATE false
      UPDATE true

      and when I tried to execute 'mv /tmp/modeshape5274288099061789508.tmp /qa/services/hudson/hudson_workspace/workspace/soa-modeshape-single/modeshape/extensions/modeshape-connector-filesystem/target/repositories/test/testFile' then the command was executed successfully.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  bcarothers Brian Carothers
                  Reporter:
                  jpechanec Jiri Pechanec
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: