BewareMyPower commented on code in PR #551:
URL: https://github.com/apache/pulsar-client-cpp/pull/551#discussion_r2905747906
##########
lib/ConnectionPool.cc:
##########
@@ -61,8 +63,18 @@ bool ConnectionPool::close() {
if (cnx) {
// The 2nd argument is false because removing a value during the
iteration will cause segfault
cnx->close(ResultDisconnected, false);
+ for (int i = 0; i < 5000 && cnx->pendingOperations() > 0; i++) {
+ using namespace std::chrono_literals;
+ std::this_thread::sleep_for(1ms);
+ }
Review Comment:
It makes sense that the current `close` API could lead to deadlock easily,
but it's so designed for strong consistency, so the snapshot based solution is
not acceptable.
--
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]