You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/04/06 16:20:39 UTC

[GitHub] [pulsar] merlimat commented on a change in pull request #10144: [C++] Fixed releasing semaphore and memory quota after send timeout

merlimat commented on a change in pull request #10144:
URL: https://github.com/apache/pulsar/pull/10144#discussion_r607996099



##########
File path: pulsar-client-cpp/lib/ProducerImpl.cc
##########
@@ -255,12 +255,14 @@ std::shared_ptr<ProducerImpl::PendingCallbacks> ProducerImpl::getPendingCallback
     // without holding producer mutex.
     for (auto& op : pendingMessagesQueue_) {
         callbacks->opSendMsgs.push_back(op);
+        releaseSemaphoreForSendOp(op);
     }
 
     if (batchMessageContainer_) {
         OpSendMsg opSendMsg;
         if (batchMessageContainer_->createOpSendMsg(opSendMsg) == ResultOk) {
             callbacks->opSendMsgs.emplace_back(opSendMsg);
+            releaseSemaphoreForSendOp(opSendMsg);

Review comment:
       That's 100% correct again. The opSendMsg is always set by the `batchMessageContainer`. Fixed.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org