[
https://issues.apache.org/jira/browse/IGNITE-28376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18069569#comment-18069569
]
Igor Sapego commented on IGNITE-28376:
--------------------------------------
Looks good.
> ClientInboundMessageHandler sends invalid or duplicated responses
> -----------------------------------------------------------------
>
> Key: IGNITE-28376
> URL: https://issues.apache.org/jira/browse/IGNITE-28376
> Project: Ignite
> Issue Type: Bug
> Components: thin clients ai3
> Reporter: Pavel Tupitsyn
> Assignee: Pavel Tupitsyn
> Priority: Critical
> Labels: ignite-3
> Fix For: 3.2
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> *ClientInboundMessageHandler#processOperation*:
> - Can return -1 if server encounters an exception before it can read the
> request ID
> - Can return duplicate response from the catch block if the response was
> already sent
> {code:java}
> long requestId = -1; // Initialized to -1
> int opCode = -1;
> try {
> opCode = in.unpackInt(); // Line 880
> requestId = in.unpackLong(); // Line 881
> // ...
> } catch (Throwable t) {
> writeError(requestId, opCode, t, ctx, false); // Line 914 - sends
> error with requestId=-1
> }
> {code}
> Proposed fixes:
> - Do not send response with ID = -1, client can't understand it. Log an error
> and close the connection instead.
> - Ensure no duplicate responses (e.g. pass around an atomic)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)