Copilot commented on code in PR #49471:
URL: https://github.com/apache/doris/pull/49471#discussion_r2052964940


##########
fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/sessions/FlightSessionsWithTokenManager.java:
##########
@@ -65,12 +66,19 @@ public ConnectContext createConnectContext(String 
peerIdentity) {
         flightTokenDetails.setCreatedSession(true);
         ConnectContext connectContext = 
FlightSessionsManager.buildConnectContext(peerIdentity,
                 flightTokenDetails.getUserIdentity(), 
flightTokenDetails.getRemoteIp());
-        ExecuteEnv.getInstance().getScheduler().submit(connectContext);
-        if 
(!ExecuteEnv.getInstance().getScheduler().registerConnection(connectContext)) {
-            String err = "Reach limit of connections, increase 
`qe_max_connection` in fe.conf, or decrease "
-                    + "`arrow_flight_token_cache_size` to evict unused bearer 
tokens and it connections faster";
-            
connectContext.getState().setError(ErrorCode.ERR_TOO_MANY_USER_CONNECTIONS, 
err);
-            throw new IllegalArgumentException(err);
+        ConnectScheduler connectScheduler = 
ExecuteEnv.getInstance().getScheduler();
+        connectScheduler.submit(connectContext);
+        int res = connectScheduler.registerConnection(connectContext);
+        if (res >= 0) {
+            long userConnLimit = 
connectContext.getEnv().getAuth().getMaxConn(connectContext.getQualifiedUser());
+            String errMsg = String.format(
+                    "Reach limit of connections. Total: %d, User: %d, Current: 
%d. "
+                            + "Increase `qe_max_connection` in fe.conf or 
user's `max_user_connections`,"
+                            + " or decrease `arrow_flight_token_cache_size` "
+                            + "to evict unused bearer tokens and it 
connections faster",

Review Comment:
   There appears to be a typo in the error message: consider replacing "it 
connections" with "its connections" for clarity.
   ```suggestion
                               + "to evict unused bearer tokens and its 
connections faster",
   ```



-- 
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]

Reply via email to