rdhabalia commented on issue #561: Fix: CPP release baseCommand after serializing it URL: https://github.com/apache/incubator-pulsar/pull/561#issuecomment-314933904 > I don't understand clearly how this relates with topic lookup requests, which it seems to be changed in the PR. `cmd.mutable_CMD` always returns the same object reference which will not be thread-safe if multiple thread calls on same `BaseCommand cmd`. as you can see in previous comment updating `num_message` doesn't get reset/destroy for subsequent call. Now, [lookup call doesn't take lock before using BaseCommand.mutable_lookuptopic](https://github.com/apache/incubator-pulsar/blob/master/pulsar-client-cpp/lib/ClientConnection.cc?utf8=%E2%9C%93#L941), therefore, concurrent lookup thread can update the value of this reference which is not thread-safe. now, we might not want to take lock on lookup for performance so, I added new BaseCommand creation while serializing lookup-command. ---------------------------------------------------------------- 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
