codelipenghui commented on PR #17318:
URL: https://github.com/apache/pulsar/pull/17318#issuecomment-1250898450

   > @codelipenghui because, if check the epoch before polling the message from 
the receiver queue, the user invoke redeliverUnacknowledgedMessages and the 
client checks the message epoch at the same time, the invalid epoch also can 
offer to the queue. user also can receive the smaller epoch message
   
   It looks like a race condition here. Is it possible to introduce a lock or 
use the same thread for `messageReceived` and `redeliverUnacknowledgedMessages` 
to resolve the issue?
   
   My point is we should try to prevent the messages with invalid epoch in the 
first place, so that we don't need to handle this case for `receive()`, 
`batchReceive()`. And as I described in 
https://github.com/apache/pulsar/pull/17318#issuecomment-1250524811, it will 
also distort client stats.


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