maedhroz commented on code in PR #3655:
URL: https://github.com/apache/cassandra/pull/3655#discussion_r1905919258
##########
src/java/org/apache/cassandra/transport/CQLMessageHandler.java:
##########
@@ -747,18 +779,71 @@ private void markBackpressure(Overload backpressure)
this.backpressure = backpressure;
}
+ private void markTooBig()
+ {
+ this.tooBig = true;
+ }
+
+ protected void onIntactFrame(IntactFrame frame)
Review Comment:
nit: `@Override`
##########
src/java/org/apache/cassandra/transport/CQLMessageHandler.java:
##########
@@ -747,18 +779,71 @@ private void markBackpressure(Overload backpressure)
this.backpressure = backpressure;
}
+ private void markTooBig()
+ {
+ this.tooBig = true;
+ }
+
+ protected void onIntactFrame(IntactFrame frame)
+ {
+ if (tooBig || overload != Overload.NONE)
+ // we do not want to add the frame to buffers (to not consume
a lot of memory and throw it away later
+ // we also do not want to release capacity because we haven't
accuired it
+ frame.consume();
+ else
+ super.onIntactFrame(frame);
+ }
+
+ protected void onCorruptFrame()
Review Comment:
nit: `@Override`
##########
src/java/org/apache/cassandra/transport/CQLMessageHandler.java:
##########
@@ -747,18 +779,71 @@ private void markBackpressure(Overload backpressure)
this.backpressure = backpressure;
}
+ private void markTooBig()
+ {
+ this.tooBig = true;
+ }
+
+ protected void onIntactFrame(IntactFrame frame)
+ {
+ if (tooBig || overload != Overload.NONE)
+ // we do not want to add the frame to buffers (to not consume
a lot of memory and throw it away later
+ // we also do not want to release capacity because we haven't
accuired it
+ frame.consume();
+ else
+ super.onIntactFrame(frame);
+ }
+
+ protected void onCorruptFrame()
+ {
+ if (!isExpired && !isCorrupt && !tooBig)
+ {
+ releaseBuffers(); // release resources once we transition from
normal state to corrupt
+ if (overload != Overload.BYTES_IN_FLIGHT)
+ releaseCapacity(size);
+ }
+ isCorrupt = true;
+ isExpired |= approxTime.isAfter(expiresAtNanos);
+ }
+
+
protected void onComplete()
Review Comment:
nit: `@Override`
--
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]