mdayakar commented on code in PR #6168:
URL: https://github.com/apache/hive/pull/6168#discussion_r2498515075
##########
service/src/test/org/apache/hive/service/cli/TestCLIServiceConnectionLimits.java:
##########
@@ -345,6 +347,83 @@ public void testConnectionForwardedIpAddresses() throws
HiveSQLException {
}
}
+ @Test
+ public void testConnectionLimitPerUserWhenSessionCreationFails() throws
HiveSQLException {
+ conf.setIntVar(HiveConf.ConfVars.HIVE_SERVER2_LIMIT_CONNECTIONS_PER_USER,
2);
+
conf.setIntVar(HiveConf.ConfVars.HIVE_SERVER2_LIMIT_CONNECTIONS_PER_IPADDRESS,
0);
+
conf.setIntVar(HiveConf.ConfVars.HIVE_SERVER2_LIMIT_CONNECTIONS_PER_USER_IPADDRESS,
0);
+ CLIService service = getService(conf);
+ HashMap<String, String> sessionConf = new HashMap<>(1);
+ // modifying this property at runtime is not allowed, it will throw
exception and session will not be created
+ sessionConf.put("hive.in.test", "true");
+ try {
+ // Here limit is set as 2 but if session creation fails it shouldn't
increment the count
+ for (int i = 0; i < 3 + 1; i++) {
Review Comment:
It's a copy paste mistake, I changed it to 3 now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]