zhuyaogai commented on code in PR #5217:
URL: https://github.com/apache/kyuubi/pull/5217#discussion_r1309714149
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/SessionLimiter.scala:
##########
@@ -95,7 +95,10 @@ class SessionLimiterImpl(userLimit: Int, ipAddressLimit:
Int, userIpAddressLimit
private def decrLimitCount(key: String): Unit = {
_counters.get(key) match {
- case count: AtomicInteger => count.decrementAndGet()
+ case count: AtomicInteger =>
+ if (count.decrementAndGet() < 0) {
+ count.incrementAndGet()
+ }
Review Comment:
@pan3793 hi, my implementation can also pass tests, but @bowenliang123
proposed another implementation.Could you review it and give some suggestions?
Thanks!
--
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]