Skip to content

Commit e4b7b53

Browse files
committed
YARN-11656 RMStateStore event queue blocked
- fix out of array exception
1 parent 3b56ade commit e4b7b53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public MultiDispatcherExecutor(
5757

5858
public void execute(Event event, Runnable runnable) {
5959
String lockKey = event.getLockKey();
60-
int threadIndex = lockKey == null ? 0 : lockKey.hashCode() % threads.length;
60+
int threadIndex = lockKey == null ? 0 : Math.abs(lockKey.hashCode()) % threads.length;
6161
MultiDispatcherExecutorThread thread = threads[threadIndex];
6262
thread.add(runnable);
6363
LOG.debug("The {} with lock key {} will be handled by {}",

0 commit comments

Comments
 (0)