Skip to content

Commit 3b56ade

Browse files
committed
YARN-11656 RMStateStore event queue blocked
- fix thread name - sort log records in monitor
1 parent f0788b5 commit 3b56ade

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/event/multidispatcher/MultiDispatcher.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,10 @@ private void createMonitorThread(MultiDispatcherConfig config) {
135135
.namingPattern(this.dispatcherName + "-monitor-%d")
136136
.build());
137137
monitorExecutor.scheduleAtFixedRate(() -> {
138-
List<String> notEmptyQueues = workerExecutor.getQueueSize().entrySet().stream()
138+
List<String> notEmptyQueues = workerExecutor.getQueuesSize().entrySet().stream()
139139
.filter(e -> 0 < e.getValue())
140140
.map(e -> String.format("%s has queue size %d", e.getKey(), e.getValue()))
141+
.sorted()
141142
.collect(Collectors.toList());
142143
if (!notEmptyQueues.isEmpty()) {
143144
log.info("Event queue sizes: {}", notEmptyQueues);

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/event/multidispatcher/MultiDispatcherExecutor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void stop() throws InterruptedException {
7878
}
7979
}
8080

81-
public Map<String, Long> getQueueSize() {
81+
public Map<String, Long> getQueuesSize() {
8282
return Arrays.stream(threads).collect(Collectors.toMap(
8383
MultiDispatcherExecutorThread::getName,
8484
MultiDispatcherExecutorThread::queueSize
@@ -89,7 +89,7 @@ private final class MultiDispatcherExecutorThread extends Thread {
8989
private final BlockingQueue<Runnable> queue;
9090

9191
MultiDispatcherExecutorThread(ThreadGroup group, int index, int queueSize) {
92-
super(group, String.format("Thread-%d", index));
92+
super(group, String.format("%s-worker-%d", group.getName(), index));
9393
this.queue = new LinkedBlockingQueue<>(queueSize);
9494
}
9595

0 commit comments

Comments
 (0)