lhotari commented on a change in pull request #14556:
URL: https://github.com/apache/pulsar/pull/14556#discussion_r819597508
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractBaseDispatcher.java
##########
@@ -145,9 +145,10 @@ public int
filterEntriesForConsumer(Optional<EntryWrapper[]> entryWrapper, int e
MessageMetadata msgMetadata = entryWrapper.isPresent() &&
entryWrapper.get()[entryWrapperIndex] != null
? entryWrapper.get()[entryWrapperIndex].getMetadata()
: null;
- msgMetadata = msgMetadata == null
- ? Commands.peekMessageMetadata(metadataAndPayload,
subscription.toString(), -1)
- : msgMetadata;
+ if (msgMetadata == null) {
Review comment:
> If we have to pass it to another method, we should make a copy.
I guess that would be one way to define a rule when to make a copy. (btw. I
wonder if it's intentional that the generated copyFrom code doesn't call
"clear" as the first step internally. )
--
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]