Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-2284

LogFormatter and SnapshotFormatter does not handle FileNotFoundException gracefully

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.5.0
    • 3.6.0, 3.5.5
    • None

    Description

      LogFormatter and SnapshotFormatter does not handle FileNotFoundException gracefully. If file no exist then these classes propagate the exception to console.

      Exception in thread "main" java.io.FileNotFoundException: log.1 (The system cannot find the file specified)
              at java.io.FileInputStream.open(Native Method)
              at java.io.FileInputStream.<init>(FileInputStream.java:146)
              at java.io.FileInputStream.<init>(FileInputStream.java:101)
              at org.apache.zookeeper.server.LogFormatter.main(LogFormatter.java:49)
      

      File existence should be validated and appropriate message should be displayed on console if file does not exist

      Attachments

        1. ZOOKEEPER-2284-01.patch
          2 kB
          Mohammad Arshad
        2. ZOOKEEPER-2284-02.patch
          6 kB
          Mohammad Arshad
        3. ZOOKEEPER-2284-03.patch
          6 kB
          Mohammad Arshad
        4. ZOOKEEPER-2284-04.patch
          7 kB
          Mohammad Arshad

        Activity

          People

            maoling Ling Mao
            arshad.mohammad Mohammad Arshad
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 3.5h
                3.5h