Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-10813

Possible over-catch of exceptions

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.96.1
    • Fix Version/s: 0.99.0
    • Component/s: regionserver, util
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      There are a few cases found by a tool that are possibly over-catch of exceptions, especially those that will abort the server. Over-catching these exceptions may unexpectedly abort the server, and may cause problems in the future when code in the try-block evolves. I am attaching a patch against trunk that constrains the catch blocks to the exact exceptions that were thrown.

      My tool actually found one more case in 0.96.1, but I found it has already been fixed in trunk:

      Line: 1175, File: "org/apache/hadoop/hbase/master/SplitLogManager.java"
      1173:             try {
      1174:               Thread.sleep(20);
      1175:-            } catch (Exception ignoreE) {
      1175:+           } catch (InterruptedException e) {
      1176:               // ignore
      1177:             }
      

      Any feedbacks are much appreciated!

        Attachments

        1. HBase-10813-trunk.patch
          3 kB
          Ding Yuan
        2. HBASE-10813_trunk_fixed_tests.patch
          1.0 kB
          Mikhail Antonov

          Issue Links

            Activity

              People

              • Assignee:
                d.yuan Ding Yuan
                Reporter:
                d.yuan Ding Yuan
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: