Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-625

Lucene Directory's methods length, filemodified, touch should return 0L instead of FileNotFoundException for unexistent files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 4.1.0.Final
    • 4.1.0.CR3
    • None
    • None

      Lucene appears to be inconsistent on this behaviour; the FSDirectory documents a FileNotfoundException but actually returns 0 while the RAMDirectory implements the FileNotfoundException but is totally synchronized,
      I assume the FSDirectory is more reliable in this case and we got a reported error about this, my rationale is that the race condition which FSDirectory can handle is never an issue in the synchronized blocks of RAMDirectory.

      Inspecting the code of Lucene, there appears to be no harm done in returning 0 for unexistend metadata.

            sgrinove Sanne Grinovero (Inactive)
            sgrinove Sanne Grinovero (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: