[ 
https://issues.apache.org/jira/browse/IGNITE-28376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pavel Tupitsyn updated IGNITE-28376:
------------------------------------
    Description: 
*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)

  was:
*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}


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