Skip to content

Commit 860de80

Browse files
authored
[ISSUE #10183] Fix incorrect brokerName when constructing processQueueTable with static topic (#10186)
1 parent d68d5a5 commit 860de80

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

client/src/main/java/org/apache/rocketmq/client/impl/consumer/ProcessQueue.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,10 @@ public void incTryUnlockTimes() {
430430
}
431431

432432
public void fillProcessQueueInfo(final ProcessQueueInfo info) {
433+
boolean lockAcquired = false;
433434
try {
434435
this.treeMapLock.readLock().lockInterruptibly();
436+
lockAcquired = true;
435437

436438
if (!this.msgTreeMap.isEmpty()) {
437439
info.setCachedMsgMinOffset(this.msgTreeMap.firstKey());
@@ -454,8 +456,11 @@ public void fillProcessQueueInfo(final ProcessQueueInfo info) {
454456
info.setLastPullTimestamp(this.lastPullTimestamp);
455457
info.setLastConsumeTimestamp(this.lastConsumeTimestamp);
456458
} catch (Exception e) {
459+
log.error("fillProcessQueueInfo exception", e);
457460
} finally {
458-
this.treeMapLock.readLock().unlock();
461+
if (lockAcquired) {
462+
this.treeMapLock.readLock().unlock();
463+
}
459464
}
460465
}
461466

0 commit comments

Comments
 (0)