alex-plekhanov commented on a change in pull request #8483:
URL: https://github.com/apache/ignite/pull/8483#discussion_r533915757



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java
##########
@@ -292,7 +233,8 @@ private ClientRequestFuture send(ClientOperation op, 
Consumer<PayloadOutputChann
 
             req.writeInt(0, req.position() - 4); // Actual size.
 
-            write(req.array(), req.position());
+            // arrayCopy is required, because buffer is pooled, and write is 
async.
+            write(req.arrayCopy(), req.position());

Review comment:
       We can also make micro-optimization - avoid `arrayCopy` for sync 
requests without a timeout, in this case, the thread can't reuse buffer again 
until the response is received. And latency for such operations will be a 
little bit better. (Perhaps this can be made in another ticket)




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to