netudima commented on code in PR #3655:
URL: https://github.com/apache/cassandra/pull/3655#discussion_r1858969064


##########
src/java/org/apache/cassandra/transport/CQLMessageHandler.java:
##########
@@ -518,10 +533,23 @@ protected boolean 
processFirstFrameOfLargeMessage(IntactFrame frame, Limit endpo
             // max CQL message size defaults to 256mb, so should be safe to 
downcast
             int messageSize = Ints.checkedCast(header.bodySizeInBytes);
             receivedBytes += buf.remaining();
+
+            if (authMessageTooBig(messageSize))
+            {
+                // we raise a fatal error and close the connection,
+                // so it does not make sense to continue frames processing
+                ClientMetrics.instance.markRequestDiscarded();
+                return false;
+            }
             
             LargeMessage largeMessage = new LargeMessage(header);
-
-            if (throwOnOverload)
+            if (messageSize > MAX_CQL_MESSAGE_SIZE)

Review Comment:
   there is one more thing to fix actually - handleErrorAndRelease invocation 
is not correct in my case onComplete, because there is no capacity to release 
it back, so it should be handleError. Probably it is applicable for overload == 
Overload.BYTES_IN_FLIGHT as well but I need to double check 



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