HIVE-27805: Hive server2 connections limits bug #6168
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



HIVE-27805: Hive server2 connections limits bug
What changes were proposed in this pull request?
When
hive.server2.limit.connections.per.user/hive.server2.limit.connections.per.ipaddress/hive.server2.limit.connections.per.user.ipaddressproperties are configured with some positive integer values then the session requests from same user/same ip/same user:ip are restricted to the value configured and these counts are getting increased while opening a session and getting decreased when the session is closed but if session creation/opening has some issues then these counts are not getting decreased which leads once the count reaches the configured value no sesions will be created for the same user/ip/user:ip even though there are no valid/active sessions. Now as a part of this PR, decreasing the count in all error scenarios when a session creation/opening fails.Why are the changes needed?
To fix the issue mentioned in HIVE-27805
Does this PR introduce any user-facing change?
No
How was this patch tested?
Unit tests are added.