Eric Lin created HIVE-13160: ------------------------------- Summary: HS2 unable to load UDFs on startup when HMS is not ready Key: HIVE-13160 URL: https://issues.apache.org/jira/browse/HIVE-13160 Project: Hive Issue Type: Bug Components: HiveServer2 Affects Versions: 1.2.1 Reporter: Eric Lin Assignee: Vaibhav Gumashta
The error looks like this: {code} 2016-02-24 21:16:09,901 INFO hive.metastore: [main]: Trying to connect to metastore with URI thrift://host-10-17-81-201.coe.cloudera.com:9083 2016-02-24 21:16:09,971 WARN hive.metastore: [main]: Failed to connect to the MetaStore Server... 2016-02-24 21:16:09,971 INFO hive.metastore: [main]: Waiting 1 seconds before next connection attempt. 2016-02-24 21:16:10,971 INFO hive.metastore: [main]: Trying to connect to metastore with URI thrift://host-10-17-81-201.coe.cloudera.com:9083 2016-02-24 21:16:10,975 WARN hive.metastore: [main]: Failed to connect to the MetaStore Server... 2016-02-24 21:16:10,976 INFO hive.metastore: [main]: Waiting 1 seconds before next connection attempt. 2016-02-24 21:16:11,976 INFO hive.metastore: [main]: Trying to connect to metastore with URI thrift://host-10-17-81-201.coe.cloudera.com:9083 2016-02-24 21:16:11,979 WARN hive.metastore: [main]: Failed to connect to the MetaStore Server... 2016-02-24 21:16:11,979 INFO hive.metastore: [main]: Waiting 1 seconds before next connection attempt. 2016-02-24 21:16:12,987 WARN hive.ql.metadata.Hive: [main]: Failed to register all functions. java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient ..... 2016-02-24 21:16:12,995 INFO hive.metastore: [main]: Trying to connect to metastore with URI thrift://host-10-17-81-201.coe.cloudera.com:9083 2016-02-24 21:16:13,004 WARN hive.metastore: [main]: Failed to connect to the MetaStore Server... 2016-02-24 21:16:13,004 INFO hive.metastore: [main]: Waiting 1 seconds before next connection attempt. 2016-02-24 21:16:14,004 INFO hive.metastore: [main]: Trying to connect to metastore with URI thrift://host-10-17-81-201.coe.cloudera.com:9083 2016-02-24 21:16:14,007 WARN hive.metastore: [main]: Failed to connect to the MetaStore Server... 2016-02-24 21:16:14,007 INFO hive.metastore: [main]: Waiting 1 seconds before next connection attempt. 2016-02-24 21:16:15,007 INFO hive.metastore: [main]: Trying to connect to metastore with URI thrift://host-10-17-81-201.coe.cloudera.com:9083 2016-02-24 21:16:15,010 WARN hive.metastore: [main]: Failed to connect to the MetaStore Server... 2016-02-24 21:16:15,010 INFO hive.metastore: [main]: Waiting 1 seconds before next connection attempt. 2016-02-24 21:16:16,012 INFO org.apache.hive.service.server.HiveServer2: [main]: Shutting down HiveServer2 2016-02-24 21:16:16,014 INFO org.apache.hive.service.server.HiveServer2: [main]: Exception caught when calling stop of HiveServer2 before retrying start java.lang.NullPointerException at org.apache.hive.service.server.HiveServer2.stop(HiveServer2.java:283) at org.apache.hive.service.server.HiveServer2.startHiveServer2(HiveServer2.java:351) at org.apache.hive.service.server.HiveServer2.access$400(HiveServer2.java:69) at org.apache.hive.service.server.HiveServer2$StartOptionExecutor.execute(HiveServer2.java:545) at org.apache.hive.service.server.HiveServer2.main(HiveServer2.java:418) .... 2016-02-24 21:16:16,014 WARN org.apache.hive.service.server.HiveServer2: [main]: Error starting HiveServer2 on attempt 1, will retry in 60 seconds ...... 2016-02-24 21:17:16,016 INFO org.apache.hive.service.server.HiveServer2: [main]: Starting HiveServer2 2016-02-24 21:17:16,131 WARN org.apache.hadoop.hive.conf.HiveConf: [main]: HiveConf of name hive.sentry.conf.url does not exist 2016-02-24 21:17:16,132 WARN org.apache.hadoop.hive.conf.HiveConf: [main]: HiveConf of name hive.entity.capture.input.URI does not exist 2016-02-24 21:17:16,150 INFO org.apache.hadoop.security.UserGroupInformation: [main]: Login successful for user hive/host-10-17-81-201.coe.cloudera....@yshi.com using keytab file hive.keytab 2016-02-24 21:17:16,150 INFO org.apache.hive.service.cli.CLIService: [main]: SPNego httpUGI not created, spNegoPrincipal: , ketabFile: 2016-02-24 21:17:16,154 INFO hive.metastore: [main]: Trying to connect to metastore with URI thrift://host-10-17-81-201.coe.cloudera.com:9083 2016-02-24 21:17:16,217 INFO hive.metastore: [main]: Opened a connection to metastore, current connections: 1 2016-02-24 21:17:16,218 INFO hive.metastore: [main]: Connected to metastore. {code} And then none of the functions will be available for use as HS2 does not re-register them after HMS is up and ready. This is not desired behaviour, we shouldn't allow HS2 to be in a servicing state if function list is not ready. Or, maybe instead of initialize the function list when HS2 starts, try to load the function list when each Hive session is created. Of course we can have a cache of function list somewhere for better performance, but we would better decouple it from class Hive. -- This message was sent by Atlassian JIRA (v6.3.4#6332)