Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-8

Interrupting the namenode thread triggers System.exit()

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      My service setup/teardown tests are managing to trigger system exits in the namenode, which seems overkill.

      1. Interrupting the thread that is starting the namesystem up raises a java.nio.channels.ClosedByInterruptException.
      2. This is caught in FSImage.rollFSImage, and handed off to processIOError
      3. This triggers a call to Runtime.getRuntime().exit(-1); "All storage directories are inaccessible.".

      Stack trace to follow. Exiting the JVM is somewhat overkill; if someone has interrupted the thread is is (presumably) because they want to stop the namenode, which may not imply they want to kill the JVM at the same time. Certainly JUnit does not expect it.

      Some possibilities
      -ClosedByInterruptException get handled differently as some form of shutdown request
      -Calls to system exit are factored out into something that can have its behaviour changed by policy options to throw a RuntimeException instead.
      Hosting a Namenode in a security manager that blocks off System.exit() is the simplest workaround; this is fairly simple, but it means that what would be a straight exit does now get turned into an exception, so callers may be surprised by what happens.

        Activity

        steve_l created issue -
        Owen O'Malley made changes -
        Field Original Value New Value
        Project Hadoop Common [ 12310240 ] HDFS [ 12310942 ]
        Key HADOOP-4532 HDFS-8
        Affects Version/s 0.20.0 [ 12313438 ]
        Component/s dfs [ 12310710 ]
        Gavin made changes -
        Reporter Steve Loughran [ steve_l ] Steve Loughran [ stevel@apache.org ]
        Steve Loughran made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Cannot Reproduce [ 5 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Steve Loughran
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development