Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8031438

FileHandler throws OverlappingFileLockException

    XMLWordPrintable

Details

    Description

      FULL PRODUCT VERSION :
      java version "1.7.0_45"
      Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
      Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      The FileHandler documentation doesn't declare that OverlappingFileLockException can be thrown from the constructor. Reading the FileChannel.tryLock documentation it appears that failure to acquire a lock can be indicated by returning null or throwing an OverlappingFileLockException. The FileHandler.openFiles method doesn't seem to handle the case of OverlappingFileLockException being thrown since it extends IllegalStateException.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Use a network file system.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Add a catch block to FileHandler openFiles for OverlappingFileLockException and set available to false.
      ACTUAL -
      Undocumented OverlappingFileLockException being thrown from constructor.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      OverlappingFileLockException

      REPRODUCIBILITY :
      This bug can be reproduced rarely.

      ---------- BEGIN SOURCE ----------
      See "OverlappingFileLockException while logging" at

      http://stackoverflow.com/questions/20631880/overlappingfilelockexception-while-logging
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Catch the exception and try a different file pattern.

      Attachments

        Issue Links

          Activity

            People

              dfuchs Daniel Fuchs
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: