hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hrishikesh tiwary (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-11935) Race condition in HiveMetaStoreClient: isCompatibleWith and close
Date Fri, 03 May 2019 07:35:01 GMT

    [ https://issues.apache.org/jira/browse/HIVE-11935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16832310#comment-16832310
] 

Hrishikesh tiwary commented on HIVE-11935:
------------------------------------------

I am using Spark 2.2 , Hive 2.1.1 and running multiple threads in same JVM  which are invoking
newSession on SparkSession. using below jars for spark,hive integration.

hive-jdbc-1.2.1.spark2.jar  hive-metastore-1.2.1.spark2.jar

 

Getting below error for 4-5 threads out of 100 threads.

 

2019-05-03 02:18:26.350 [ERROR] [BatchFileProcessorService-93] [org.apache.hadoop.hive.ql.session.SessionState:743]
Error setting up authorization: null
org.apache.hadoop.hive.ql.metadata.HiveException: null
 at org.apache.hadoop.hive.ql.session.SessionState.setAuthorizerV2Config(SessionState.java:769)
 at org.apache.hadoop.hive.ql.session.SessionState.setupAuth(SessionState.java:736)
 at org.apache.hadoop.hive.ql.session.SessionState.getAuthenticator(SessionState.java:1391)
 at org.apache.spark.sql.hive.client.HiveClientImpl.<init>(HiveClientImpl.scala:210)
 at sun.reflect.GeneratedConstructorAccessor129.newInstance(Unknown Source)
 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
 at org.apache.spark.sql.hive.client.IsolatedClientLoader.createClient(IsolatedClientLoader.scala:264)
 at org.apache.spark.sql.hive.client.HiveClientImpl.newSession(HiveClientImpl.scala:762)
 at org.apache.spark.sql.hive.client.HiveClientImpl.newSession(HiveClientImpl.scala:79)
 at org.apache.spark.sql.hive.HiveSessionStateBuilder.resourceLoader$lzycompute(HiveSessionStateBuilder.scala:45)
 at org.apache.spark.sql.hive.HiveSessionStateBuilder.resourceLoader(HiveSessionStateBuilder.scala:44)
 at org.apache.spark.sql.hive.HiveSessionStateBuilder.catalog$lzycompute(HiveSessionStateBuilder.scala:61)
 at org.apache.spark.sql.hive.HiveSessionStateBuilder.catalog(HiveSessionStateBuilder.scala:52)
 at org.apache.spark.sql.hive.HiveSessionStateBuilder.catalog(HiveSessionStateBuilder.scala:35)
 at org.apache.spark.sql.internal.BaseSessionStateBuilder.build(BaseSessionStateBuilder.scala:289)
 at org.apache.spark.sql.SparkSession$.org$apache$spark$sql$SparkSession$$instantiateSessionState(SparkSession.scala:1050)
 at org.apache.spark.sql.SparkSession$$anonfun$sessionState$2.apply(SparkSession.scala:130)
 at org.apache.spark.sql.SparkSession$$anonfun$sessionState$2.apply(SparkSession.scala:130)

at org.apache.spark.sql.SparkSession$$anonfun$sessionState$2.apply(SparkSession.scala:130)
 at org.apache.spark.sql.SparkSession$$anonfun$sessionState$2.apply(SparkSession.scala:130)
 at scala.Option.getOrElse(Option.scala:121)
 at org.apache.spark.sql.SparkSession.sessionState$lzycompute(SparkSession.scala:129)
 at org.apache.spark.sql.SparkSession.sessionState(SparkSession.scala:126)
 at org.apache.spark.sql.DataFrameReader.<init>(DataFrameReader.scala:689)
 at org.apache.spark.sql.SparkSession.read(SparkSession.scala:636)
 at com.citi.commgxs.core.repo.SparkRepository.loadDataToSparkBinaryPartitioned(SparkRepository.java:178)
 at com.citi.commgxs.core.repo.SparkRepository$$FastClassBySpringCGLIB$$896582bc.invoke(<generated>)
 at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
 at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
 at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
 at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
 at org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:47)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
 at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
 at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
 at com.citi.commgxs.core.repo.SparkRepository$$EnhancerBySpringCGLIB$$dd4f1975.loadDataToSparkBinaryPartitioned(<generated>)
 at com.citi.commgxs.core.service.HDFSDataServiceImpl.loadToStaticPartition(HDFSDataServiceImpl.java:146)
 at com.citi.commgxs.core.service.HDFSDataServiceImpl.loadToPartition(HDFSDataServiceImpl.java:119)
 at com.citi.commgxs.core.service.HDFSDataServiceImpl.loadData(HDFSDataServiceImpl.java:67)
 at com.citi.commgxs.core.service.HDFSDataServiceImpl$$FastClassBySpringCGLIB$$a2a3c538.invoke(<generated>)
 at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
 at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
 at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
 at org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:47)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
 at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
 at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
 at com.citi.commgxs.core.service.HDFSDataServiceImpl$$EnhancerBySpringCGLIB$$78594e69.loadData(<generated>)
 at com.citi.comm.gxs.api.CoreClient.invoke(CoreClient.java:29)
 at com.citi.comm.gxs.bean.CoreClientHelper.loadToHive(CoreClientHelper.java:52)
 at com.citi.comm.gxs.filewatcher.BatchFileWatcherProcessor.dumpFileToHive(BatchFileWatcherProcessor.java:162)
 at com.citi.comm.gxs.filewatcher.BatchFileWatcherProcessor.prepareFileToLoad(BatchFileWatcherProcessor.java:99)
 at com.citi.comm.gxs.filewatcher.BatchFileWatcherProcessor.processBatchFile(BatchFileWatcherProcessor.java:66)
 at com.citi.comm.gxs.filewatcher.BatchFileWatcherProcessor.call(BatchFileWatcherProcessor.java:48)
 at com.citi.comm.gxs.filewatcher.BatchFileWatcherProcessor.call(BatchFileWatcherProcessor.java:24)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException: null
 at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.isCompatibleWith(HiveMetaStoreClient.java:287)
 at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:156)
 at com.sun.proxy.$Proxy115.isCompatibleWith(Unknown Source)
 at org.apache.hadoop.hive.ql.metadata.Hive.get(Hive.java:206)
 at org.apache.hadoop.hive.ql.session.SessionState.setAuthorizerV2Config(SessionState.java:765)
 ... 64 common frames omitted

if the fixes has been done in hive 2.1.0 then i should not get the problem. but what is the
solution for this ? 

 

> Race condition in  HiveMetaStoreClient: isCompatibleWith and close
> ------------------------------------------------------------------
>
>                 Key: HIVE-11935
>                 URL: https://issues.apache.org/jira/browse/HIVE-11935
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore
>    Affects Versions: 1.2.1
>            Reporter: Daniel Dai
>            Assignee: Daniel Dai
>            Priority: Major
>             Fix For: 1.3.0, 2.1.0
>
>         Attachments: HIVE-11935.1.patch, HIVE-11935.2.patch
>
>
> We saw intermittent failure of the following stack:
> {code}
> java.lang.NullPointerException
>         at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.isCompatibleWith(HiveMetaStoreClient.java:287)
>         at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:497)
>         at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:156)
>         at com.sun.proxy.$Proxy9.isCompatibleWith(Unknown Source)
>         at org.apache.hadoop.hive.ql.metadata.Hive.get(Hive.java:206)
>         at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.createHiveDB(BaseSemanticAnalyzer.java:205)
>         at org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer.<init>(DDLSemanticAnalyzer.java:223)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzerFactory.get(SemanticAnalyzerFactory.java:259)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:409)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:308)
>         at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1122)
>         at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:1116)
>         at org.apache.hive.service.cli.operation.SQLOperation.prepare(SQLOperation.java:110)
>         at org.apache.hive.service.cli.operation.SQLOperation.runInternal(SQLOperation.java:181)
>         at org.apache.hive.service.cli.operation.Operation.run(Operation.java:257)
>         at org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementInternal(HiveSessionImpl.java:388)
>         at org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementAsync(HiveSessionImpl.java:375)
>         at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:497)
>         at org.apache.hive.service.cli.session.HiveSessionProxy.invoke(HiveSessionProxy.java:78)
>         at org.apache.hive.service.cli.session.HiveSessionProxy.access$000(HiveSessionProxy.java:36)
>         at org.apache.hive.service.cli.session.HiveSessionProxy$1.run(HiveSessionProxy.java:63)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at javax.security.auth.Subject.doAs(Subject.java:422)
>         at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
>         at org.apache.hive.service.cli.session.HiveSessionProxy.invoke(HiveSessionProxy.java:59)
>         at com.sun.proxy.$Proxy20.executeStatementAsync(Unknown Source)
>         at org.apache.hive.service.cli.CLIService.executeStatementAsync(CLIService.java:274)
>         at org.apache.hive.service.cli.thrift.ThriftCLIService.ExecuteStatement(ThriftCLIService.java:486)
>         at org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1313)
>         at org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1298)
>         at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
>         at org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1298)
>         at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
>         at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
>         at org.apache.thrift.server.TServlet.doPost(TServlet.java:83)
>         at org.apache.hive.service.cli.thrift.ThriftHttpServlet.doPost(ThriftHttpServlet.java:171)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>         at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
>         at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
>         at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)
>         at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
>         at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
>         at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
>         at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
>         at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
>         at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
>         at org.eclipse.jetty.server.Server.handle(Server.java:349)
>         at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
>         at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:925)
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:857)
>         at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
>         at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:76)
>         at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
>         at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>         at java.lang.Thread.run(Thread.java:745)
> {code}
> HiveMetaStoreClient.isCompatibleWith does a null check of currentMetaVars in the beginning,
but it is possible HiveMetaStoreClient.close is invoked before it gets used, thus we will
see the above stack. Access of currentMetaVars should be synchronized.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message