[
https://issues.apache.org/jira/browse/HIVE-27805?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dayakar M reassigned HIVE-27805:
--------------------------------
Assignee: Dayakar M (was: Zhihua Deng)
> Hive server2 connections limits bug
> -----------------------------------
>
> Key: HIVE-27805
> URL: https://issues.apache.org/jira/browse/HIVE-27805
> Project: Hive
> Issue Type: Bug
> Components: HiveServer2
> Affects Versions: 3.1.0, 3.0.0, 3.1.1, 3.1.2, 3.1.3
> Environment: image: apache/hive:3.1.3
> jdbc driver: hive-jdbc:2.1.0
> Reporter: Xiwei Wang
> Assignee: Dayakar M
> Priority: Major
>
> When I use JDBC and specify a non-existent database to connect to a
> hiveserver2 that configured hive.server2.limit.connections.per.user=10, a
> session initialization error
> occurs(org.apache.hive.service.cli.HiveSQLException: Failed to open new
> session: Database not_exists_db does not exist); and even a normal connection
> will report an error after the number of attempts exceeds the maximum limit I
> configured (org.apache.hive.service.cli.HiveSQLException: Connection limit
> per user reached (user: aeolus limit: 10))
>
> I found that inside the method
> org.apache.hive.service.cli.session.SessionManager#createSession
> , if seesion initialization fails, it will cause the increased number of
> connections called incrementConnections cannot be released; after the number
> of failures exceeds the maximum number of connections configured by the user,
> such as hive.server2.limit.connections.per.user, hiveserver2 will not accept
> any connections due to the limitations.
>
> {code:java}
> 2023-10-17T12:14:54,313 WARN [HiveServer2-Handler-Pool: Thread-3329]
> thrift.ThriftCLIService: Error opening session:
> org.apache.hive.service.cli.HiveSQLException: Failed to open new session:
> Database not_exists_db does not exist
> at
> org.apache.hive.service.cli.session.SessionManager.createSession(SessionManager.java:434)
> ~[hive-service-3.1.3.jar:3.1.3]
> at
> org.apache.hive.service.cli.session.SessionManager.openSession(SessionManager.java:373)
> ~[hive-service-3.1.3.jar:3.1.3]
> at
> org.apache.hive.service.cli.CLIService.openSession(CLIService.java:187)
> ~[hive-service-3.1.3.jar:3.1.3]
> at
> org.apache.hive.service.cli.thrift.ThriftCLIService.getSessionHandle(ThriftCLIService.java:475)
> ~[hive-service-3.1.3.jar:3.1.3]
> at
> org.apache.hive.service.cli.thrift.ThriftCLIService.OpenSession(ThriftCLIService.java:322)
> ~[hive-service-3.1.3.jar:3.1.3]
> at
> org.apache.hive.service.rpc.thrift.TCLIService$Processor$OpenSession.getResult(TCLIService.java:1497)
> ~[hive-exec-3.1.3.jar:3.1.3]
> at
> org.apache.hive.service.rpc.thrift.TCLIService$Processor$OpenSession.getResult(TCLIService.java:1482)
> ~[hive-exec-3.1.3.jar:3.1.3]
> at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
> ~[hive-exec-3.1.3.jar:3.1.3]
> at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
> ~[hive-exec-3.1.3.jar:3.1.3]
> at
> org.apache.hive.service.auth.TSetIpAddressProcessor.process(TSetIpAddressProcessor.java:56)
> ~[hive-service-3.1.3.jar:3.1.3]
> at
> org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)
> ~[hive-exec-3.1.3.jar:3.1.3]
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> ~[?:1.8.0_342]
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> ~[?:1.8.0_342]
> at java.lang.Thread.run(Thread.java:750) [?:1.8.0_342]
> Caused by: org.apache.hive.service.cli.HiveSQLException: Database dw_aeolus
> does not exist
> at
> org.apache.hive.service.cli.session.HiveSessionImpl.configureSession(HiveSessionImpl.java:294)
> ~[hive-service-3.1.3.jar:3.1.3]
> at
> org.apache.hive.service.cli.session.HiveSessionImpl.open(HiveSessionImpl.java:199)
> ~[hive-service-3.1.3.jar:3.1.3]
> at
> org.apache.hive.service.cli.session.SessionManager.createSession(SessionManager.java:425)
> ~[hive-service-3.1.3.jar:3.1.3]
> ... 13 more
> 2023-10-17T12:14:54,972 INFO [HiveServer2-Handler-Pool: Thread-3330]
> thrift.ThriftCLIService: Client protocol version: HIVE_CLI_SERVICE_PROTOCOL_V8
> 2023-10-17T12:14:54,973 ERROR [HiveServer2-Handler-Pool: Thread-3330]
> service.CompositeService: Connection limit per user reached (user: aeolus
> limit: 10)
> 2023-10-17T12:14:54,973 WARN [HiveServer2-Handler-Pool: Thread-3330]
> thrift.ThriftCLIService: Error opening session:
> org.apache.hive.service.cli.HiveSQLException: Connection limit per user
> reached (user: aeolus limit: 10)
> at
> org.apache.hive.service.cli.session.SessionManager.incrementConnections(SessionManager.java:476)
> ~[hive-service-3.1.3.jar:3.1.3]
> at
> org.apache.hive.service.cli.session.SessionManager.createSession(SessionManager.java:383)
> ~[hive-service-3.1.3.jar:3.1.3]
> at
> org.apache.hive.service.cli.session.SessionManager.openSession(SessionManager.java:373)
> ~[hive-service-3.1.3.jar:3.1.3]
> at
> org.apache.hive.service.cli.CLIService.openSession(CLIService.java:187)
> ~[hive-service-3.1.3.jar:3.1.3]
> at
> org.apache.hive.service.cli.thrift.ThriftCLIService.getSessionHandle(ThriftCLIService.java:475)
> ~[hive-service-3.1.3.jar:3.1.3]
> at
> org.apache.hive.service.cli.thrift.ThriftCLIService.OpenSession(ThriftCLIService.java:322)
> ~[hive-service-3.1.3.jar:3.1.3]
> at
> org.apache.hive.service.rpc.thrift.TCLIService$Processor$OpenSession.getResult(TCLIService.java:1497)
> ~[hive-exec-3.1.3.jar:3.1.3]
> at
> org.apache.hive.service.rpc.thrift.TCLIService$Processor$OpenSession.getResult(TCLIService.java:1482)
> ~[hive-exec-3.1.3.jar:3.1.3]
> at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
> ~[hive-exec-3.1.3.jar:3.1.3]
> at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
> ~[hive-exec-3.1.3.jar:3.1.3]
> at
> org.apache.hive.service.auth.TSetIpAddressProcessor.process(TSetIpAddressProcessor.java:56)
> ~[hive-service-3.1.3.jar:3.1.3]
> at
> org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)
> ~[hive-exec-3.1.3.jar:3.1.3]
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> ~[?:1.8.0_342]
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> ~[?:1.8.0_342]
> at java.lang.Thread.run(Thread.java:750) [?:1.8.0_342] {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)