[ 
https://issues.apache.org/jira/browse/CASSANDRA-20933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18130455#comment-18130455
 ] 

Dmitry Konstantinov commented on CASSANDRA-20933:
-------------------------------------------------

How it happens:
1. The client sends the message as three frames (~128KiB, ~128KiB, 36 bytes), 
all in one event-loop task.
2. The server rejects it on frame 1 because the connection isn't authenticated 
yet . It writes the error frame and closes once that write completes.
3. After the rejection the server stops reading. FrameDecoder runs with 
autoRead=false and only asks for more data while it is active 
(FrameDecoder.java:286,346). So frame 2 is still unread when the server closes, 
and the kernel sends a reset (RST) instead of a normal close.
4. Usually the client finishes writing all three frames before that reset 
arrives. It then reads the error frame and the test passes. In the flaky case, 
the reset lands between frames 2 and 3, so the client's write of the 36-byte 
frame fails.
5. Netty 4.1 reacts to an IOException on write by closing the channel 
immediately, because auto-close is on by default 
(AbstractChannel.handleWriteError). This happens inside the same write task, 
before the client ever checks for incoming data. The error frame sitting in the 
client socket's buffer is discarded.

> Flaky test - transport.AuthMessageSizeLimitTest 
> sendTooBigAuthMultiFrameMessage
> -------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-20933
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-20933
>             Project: Apache Cassandra
>          Issue Type: Bug
>          Components: Test/unit
>            Reporter: Dmitry Konstantinov
>            Assignee: Dmitry Konstantinov
>            Priority: Normal
>
> AuthMessageSizeLimitTest fails from time to time.
> https://ci-cassandra.apache.org/job/Cassandra-trunk/2287/testReport/junit/org.apache.cassandra.transport/AuthMessageSizeLimitTest/Tests___test_jdk17_3_20___sendTooBigAuthMultiFrameMessage__jdk17_x86_64/



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to