rdhabalia commented on a change in pull request #541: Message size validation 
on post compression
URL: https://github.com/apache/incubator-pulsar/pull/541#discussion_r124979732
 
 

 ##########
 File path: pulsar-client-cpp/lib/ProducerImpl.cc
 ##########
 @@ -268,6 +264,14 @@ void ProducerImpl::sendAsync(const Message& msg, 
SendCallback callback) {
         // If batching is enabled we compress all the payloads together before 
sending the batch
         payload = 
CompressionCodecProvider::getCodec(conf_.getCompressionType()).encode(payload);
     }
+    uint32_t compressedSize = payload.readableBytes();
+    if (compressedSize > Commands::MaxMessageSize) {
+        if (conf_.getBlockIfQueueFull()) {
 
 Review comment:
   > it's the getBlockIfQueueFull stuff that doesn't make any sense to me. at 
the least it deserves a comment because it's bizarre a too large message would 
have anything to do with the send queue size.
   
   yes, we want to block the call if queue is full before taking mutex. So, 
updated a change to perform size-validation before checking queue-full.
 
----------------------------------------------------------------
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

Reply via email to