rdhabalia commented on a change in pull request #561: Fix: CPP release
baseCommand after serializing it
URL: https://github.com/apache/incubator-pulsar/pull/561#discussion_r127101417
##########
File path: pulsar-client-cpp/lib/Commands.cc
##########
@@ -137,6 +141,7 @@ PairSharedBuffer Commands::newSend(SharedBuffer& headers,
BaseCommand& cmd,
headers.setWriterIndex(writeIndex);
}
+ cmd.release_send();
Review comment:
actually, it doesn't destroy it and therefore, we have a bug mentioned into
the PR.
`CommandSend* send = cmd.mutable_send();` gives `send` command and updating
value of this command will remain as it is which can affect next subsequent
call.
we have verified it with below two steps:
1. send batch-message which updates `num_message=10 (eg: 10 batch-msg)`
2. using different non-batch producer send non-batch message. now,
`cmd.mutable_send()=>send` cmd already has `num_message=10` and we serialize
with wrong data.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services