alex-plekhanov commented on code in PR #13296:
URL: https://github.com/apache/ignite/pull/13296#discussion_r3577531304


##########
modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java:
##########
@@ -443,12 +457,16 @@ public ByteBuffer getBuffer() {
     @Override public void beforeNestedWrite() {
         state.forward();
 
-        state.item().stream.setBuffer(buf);
+        curStream = state.item().stream;
+
+        curStream.setBuffer(buf);
     }
 
     /** {@inheritDoc} */
     @Override public void afterNestedWrite(boolean finished) {
         state.backward(finished);
+
+        curStream = state.item().stream;

Review Comment:
   The same question as for 
https://github.com/apache/ignite/pull/13329#discussion_r3572952009
   
   Do we need additional curStream.setBuffer(buf); call here?
   Looks like currently buffer instance can't be changed during message 
serialization (setBuffer called with the same buf instance on each part of 
message). At least for communication messages , but I don't analize other code 
paths. But if we change buffer when serializing nested message there can be an 
issue when previous item holds reference to the old buffer. Maybe it's safer to 
call curStream.setBuffer(buf); here too?



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to