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

Pavel Tupitsyn commented on IGNITE-28376:
-----------------------------------------

https://github.com/apache/ignite-3/commit/2eb4d5ffdac4a9815a8f1d69c863e392b147c6da

> 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: 0.5h
>  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)

Reply via email to