BewareMyPower commented on code in PR #71:
URL: https://github.com/apache/pulsar-client-cpp/pull/71#discussion_r1013550364


##########
lib/ConsumerImpl.cc:
##########
@@ -331,6 +371,13 @@ Optional<SharedBuffer> 
ConsumerImpl::processMessageChunk(const SharedBuffer& pay
                                                  << payload.readableBytes() << 
" bytes");
 
     Lock lock(chunkProcessMutex_);
+
+    // Lazy task scheduling to expire incomplete chunk message
+    if (!checkExpiredChunkedTimer_) {
+        checkExpiredChunkedTimer_ = executor_->createDeadlineTimer();
+        triggerCheckExpiredChunkedTimer();
+    }

Review Comment:
   Just create the timer in the constructor. `createDeadlineTimer` won't start 
any timer, it only creates the object. Otherwise, we should always check it's 
not a nullptr when accessing it.



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