Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4771#discussion_r25499357
  
    --- Diff: 
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala
 ---
    @@ -57,12 +60,15 @@ object HiveThriftServer2 extends Logging {
         logInfo("Starting SparkContext")
         SparkSQLEnv.init()
     
    -    Runtime.getRuntime.addShutdownHook(
    -      new Thread() {
    +    // Clean up after we exit. Use higher priority than FileSystem.
    +    assert(SHUTDOWN_HOOK_PRIORITY > FileSystem.SHUTDOWN_HOOK_PRIORITY)
    --- End diff --
    
    Darn. Hive also has a `ShutdownHookManager` but the point here is the race 
with the hook from `FileSystem`. I don't know of a non-hacky way to ensure the 
order of shutdown with a Hadoop 1.x `FileSystem` then. It looks like in Hadoop 
1 it runs its own private `clientFinalizer` hook.
    
    Aside from insane solutions like rewriting that hook with reflection... is 
this something that has to wait until support for Hadoop <= 2.2 is dropped? I 
am guessing that is Spark 2.x.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to