Skip to content

Commit

Permalink
Fix log message bug (apache#5421)
Browse files Browse the repository at this point in the history
  • Loading branch information
liketic authored and sijie committed Nov 6, 2019
1 parent c70e143 commit 99cfe3e
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ protected boolean pickAndScheduleActiveConsumer() {

public synchronized void addConsumer(Consumer consumer) throws BrokerServiceException {
if (IS_CLOSED_UPDATER.get(this) == TRUE) {
log.warn("[{}] Dispatcher is already closed. Closing consumer ", this.topicName, consumer);
log.warn("[{}] Dispatcher is already closed. Closing consumer {}", this.topicName, consumer);
consumer.disconnect();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,7 @@ private void updateConfigurationAndRegisterListeners() {
newLoadManager.start();
pulsar.getLoadManager().set(newLoadManager);
} catch (Exception ex) {
log.warn("Failed to change load manager due to {}", ex);
log.warn("Failed to change load manager", ex);
}
});
// add listener to update message-dispatch-rate in msg for topic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ void messageAcked(CommandAck ack) {

if (ack.getAckType() == AckType.Cumulative) {
if (ack.getMessageIdCount() != 1) {
log.warn("[{}] [{}] Received multi-message ack at {} - Reason: {}", subscription, consumerId);
log.warn("[{}] [{}] Received multi-message ack", subscription, consumerId);
return;
}

Expand Down Expand Up @@ -541,7 +541,7 @@ public int getPriorityLevel() {

public void redeliverUnacknowledgedMessages() {
// cleanup unackedMessage bucket and redeliver those unack-msgs again
clearUnAckedMsgs(this);
clearUnAckedMsgs();
blockedConsumerOnUnackedMsgs = false;
if (log.isDebugEnabled()) {
log.debug("[{}-{}] consumer {} received redelivery", topicName, subscription, consumerId);
Expand Down Expand Up @@ -610,7 +610,7 @@ private int addAndGetUnAckedMsgs(Consumer consumer, int ackedMessages) {
return UNACKED_MESSAGES_UPDATER.addAndGet(consumer, ackedMessages);
}

private void clearUnAckedMsgs(Consumer consumer) {
private void clearUnAckedMsgs() {
int unaAckedMsgs = UNACKED_MESSAGES_UPDATER.getAndSet(this, 0);
subscription.addUnAckedMessages(-unaAckedMsgs);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public PersistentDispatcherMultipleConsumers(PersistentTopic topic, ManagedCurso
@Override
public synchronized void addConsumer(Consumer consumer) throws BrokerServiceException {
if (IS_CLOSED_UPDATER.get(this) == TRUE) {
log.warn("[{}] Dispatcher is already closed. Closing consumer ", name, consumer);
log.warn("[{}] Dispatcher is already closed. Closing consumer {}", name, consumer);
consumer.disconnect();
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,7 @@ public synchronized OffloadProcessStatus offloadStatus() {
return OffloadProcessStatus.forSuccess(currentOffload.join());
}
} catch (CancellationException | CompletionException e) {
log.warn("Failed to offload: {}", e.getCause());
log.warn("Failed to offload", e.getCause());
return OffloadProcessStatus.forError(e.getMessage());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public SubscribeRateLimiter(PersistentTopic topic) {
}
if (isSubscribeRateEnabled(this.subscribeRate)) {
resetTask = createTask();
log.info("[{}] [{}] configured subscribe-dispatch rate at broker {}", this.topicName, subscribeRate);
log.info("[{}] configured subscribe-dispatch rate at broker {}", this.topicName, subscribeRate);
}
}

Expand Down Expand Up @@ -163,7 +163,7 @@ public void onPoliciesUpdate(Policies data) {
}
if (isSubscribeRateEnabled(this.subscribeRate)) {
this.resetTask = createTask();
log.info("[{}] [{}] configured subscribe-dispatch rate at broker {}", this.topicName, subscribeRate);
log.info("[{}] configured subscribe-dispatch rate at broker {}", this.topicName, subscribeRate);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static SchemaRegistryService create(PulsarService pulsar) {
return SchemaRegistryServiceWithSchemaDataValidator.of(
new SchemaRegistryServiceImpl(schemaStorage, checkers));
} catch (Exception e) {
log.warn("Unable to create schema registry storage, defaulting to empty storage: {}", e);
log.warn("Unable to create schema registry storage, defaulting to empty storage", e);
}
return new DefaultSchemaRegistryService();
}
Expand Down

0 comments on commit 99cfe3e

Please sign in to comment.