Skip to content

Commit e7562cb

Browse files
committed
no log
1 parent 5c4bb9c commit e7562cb

4 files changed

Lines changed: 10 additions & 26 deletions

File tree

lib/BatchMessageContainer.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ namespace pulsar {
3030
BatchMessageContainer::BatchMessageContainer(const ProducerImpl& producer)
3131
: BatchMessageContainerBase(producer) {}
3232

33-
BatchMessageContainer::~BatchMessageContainer() {
34-
LOG_DEBUG(*this << " destructed");
35-
LOG_DEBUG("[numberOfBatchesSent = " << numberOfBatchesSent_
36-
<< "] [averageBatchSize_ = " << averageBatchSize_ << "]");
37-
}
33+
BatchMessageContainer::~BatchMessageContainer() {}
3834

3935
bool BatchMessageContainer::add(const Message& msg, const SendCallback& callback) {
4036
LOG_DEBUG("Before add: " << *this << " [message = " << msg << "]");

lib/BatchMessageKeyBasedContainer.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@ inline std::string getKey(const Message& msg) {
4040
BatchMessageKeyBasedContainer::BatchMessageKeyBasedContainer(const ProducerImpl& producer)
4141
: BatchMessageContainerBase(producer) {}
4242

43-
BatchMessageKeyBasedContainer::~BatchMessageKeyBasedContainer() {
44-
LOG_DEBUG(*this << " destructed");
45-
LOG_INFO("[numberOfBatchesSent = " << numberOfBatchesSent_
46-
<< "] [averageBatchSize_ = " << averageBatchSize_ << "]");
47-
}
43+
BatchMessageKeyBasedContainer::~BatchMessageKeyBasedContainer() {}
4844

4945
bool BatchMessageKeyBasedContainer::isFirstMessageToAdd(const Message& msg) const {
5046
auto it = batches_.find(getKey(msg));

lib/ConsumerImpl.cc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,18 +180,14 @@ ConsumerImpl::ConsumerImpl(const ClientImplPtr& client, const std::string& topic
180180
}
181181

182182
ConsumerImpl::~ConsumerImpl() {
183-
LOG_DEBUG(consumerStr_ << "~ConsumerImpl");
183+
auto client = client_.lock();
184184
if (state_ == Ready) {
185185
// this could happen at least in this condition:
186186
// consumer seek, caused reconnection, if consumer close happened before connection ready,
187187
// then consumer will not send closeConsumer to Broker side, and caused a leak of consumer in
188188
// broker.
189-
auto client = client_.lock();
190189
if (client) {
191190
LOG_WARN(consumerStr_ << "Destroyed consumer which was not properly closed");
192-
} else {
193-
LOG_DEBUG(consumerStr_
194-
<< "Destroyed consumer which was not properly closed (client already destroyed)");
195191
}
196192

197193
ClientConnectionPtr cnx = getCnx().lock();
@@ -200,12 +196,12 @@ ConsumerImpl::~ConsumerImpl() {
200196
cnx->sendRequestWithId(Commands::newCloseConsumer(consumerId_, requestId), requestId,
201197
"CLOSE_CONSUMER");
202198
cnx->removeConsumer(consumerId_);
203-
LOG_DEBUG(consumerStr_ << "Closed consumer for race condition: " << consumerId_);
199+
if (client) {
200+
LOG_DEBUG(consumerStr_ << "Closed consumer for race condition: " << consumerId_);
201+
}
204202
} else {
205203
if (client) {
206204
LOG_WARN(consumerStr_ << "Client is destroyed and cannot send the CloseConsumer command");
207-
} else {
208-
LOG_DEBUG(consumerStr_ << "Client is destroyed and cannot send the CloseConsumer command");
209205
}
210206
}
211207
}

lib/ProducerImpl.cc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,12 @@ ProducerImpl::ProducerImpl(const ClientImplPtr& client, const TopicName& topicNa
114114
}
115115

116116
ProducerImpl::~ProducerImpl() {
117-
LOG_DEBUG(producerStr_ << "~ProducerImpl");
117+
auto client = client_.lock();
118118
internalShutdown();
119-
printStats();
120-
if (state_ == Ready || state_ == Pending) {
121-
auto client = client_.lock();
122-
if (client) {
119+
if (client) {
120+
printStats();
121+
if (state_ == Ready || state_ == Pending) {
123122
LOG_WARN(producerStr_ << "Destroyed producer which was not properly closed");
124-
} else {
125-
LOG_DEBUG(producerStr_
126-
<< "Destroyed producer which was not properly closed (client already destroyed)");
127123
}
128124
}
129125
}

0 commit comments

Comments
 (0)