Hive
  1. Hive
  2. HIVE-884

Metastore Server should exit if error happens

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.4.0
    • Fix Version/s: 0.4.1
    • Component/s: Server Infrastructure
    • Labels:
      None

      Description

      Currently, HiveMetaStore (the thrift server) is not exiting when the main thread saw an Exception.
      The process should exit when that happens.

      1. HIVE-884.1.patch
        0.7 kB
        Zheng Shao
      2. HIVE-884.2.patch
        0.8 kB
        Prasad Chakka

        Activity

        Carl Steinbach made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Carl Steinbach made changes -
        Fix Version/s 0.4.1 [ 12314225 ]
        Affects Version/s 0.4.0 [ 12313714 ]
        Affects Version/s 0.5.0 [ 12314156 ]
        Affects Version/s 0.4.1 [ 12314225 ]
        Component/s Server Infrastructure [ 12312588 ]
        Prasad Chakka made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Prasad Chakka added a comment -

        committed to 0.4 and trunk. Thanks Zheng!

        Show
        Prasad Chakka added a comment - committed to 0.4 and trunk. Thanks Zheng!
        Prasad Chakka made changes -
        Attachment HIVE-884.2.patch [ 12422470 ]
        Hide
        Prasad Chakka added a comment -

        modified zheng's patch by adding an log4j error message in addition to stdout.

        Show
        Prasad Chakka added a comment - modified zheng's patch by adding an log4j error message in addition to stdout.
        Hide
        Zheng Shao added a comment -

        http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html

        When a Java Virtual Machine starts up, there is usually a single non-daemon thread (which typically calls the method named main of some designated class). The Java Virtual Machine continues to execute threads until either of the following occurs:

        • The exit method of class Runtime has been called and the security manager has permitted the exit operation to take place.
        • All threads that are not daemon threads have died, either by returning from the call to the run method or by throwing an exception that propagates beyond the run method.
        Show
        Zheng Shao added a comment - http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html When a Java Virtual Machine starts up, there is usually a single non-daemon thread (which typically calls the method named main of some designated class). The Java Virtual Machine continues to execute threads until either of the following occurs: The exit method of class Runtime has been called and the security manager has permitted the exit operation to take place. All threads that are not daemon threads have died, either by returning from the call to the run method or by throwing an exception that propagates beyond the run method.
        Hide
        Prasad Chakka added a comment -

        the main() function exits after printing the exception. when main() returns the whole process should exit. no? The problem may be something else.

        Show
        Prasad Chakka added a comment - the main() function exits after printing the exception. when main() returns the whole process should exit. no? The problem may be something else.
        Hide
        Prasad Chakka added a comment -

        i am not sure there are any testcases for stand alone metastore server. we have to start one.

        i am testing this patch (along with log message)

        Show
        Prasad Chakka added a comment - i am not sure there are any testcases for stand alone metastore server. we have to start one. i am testing this patch (along with log message)
        Hide
        Prasad Chakka added a comment -

        can you do print the stack trace to log as well, if logging was initialized? I don't think printing to stdout will result in updating log.

        Show
        Prasad Chakka added a comment - can you do print the stack trace to log as well, if logging was initialized? I don't think printing to stdout will result in updating log.
        Hide
        Ashish Thusoo added a comment -

        Can we add a test case?

        Otherwise changes look good

        Show
        Ashish Thusoo added a comment - Can we add a test case? Otherwise changes look good
        Zheng Shao made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Zheng Shao made changes -
        Field Original Value New Value
        Attachment HIVE-884.1.patch [ 12422460 ]
        Hide
        Zheng Shao added a comment -

        For both branch 0.4 and trunk.

        Show
        Zheng Shao added a comment - For both branch 0.4 and trunk.
        Zheng Shao created issue -

          People

          • Assignee:
            Zheng Shao
            Reporter:
            Zheng Shao
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development