This is an automated email from the ASF dual-hosted git repository.
pan3793 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 1cca0061942 HDFS-17930. [ARR] Router shutdown should not shut
routerAsyncResponderExecutor down (#8527)
1cca0061942 is described below
commit 1cca00619424eff758a3872f9c5b40f9ef9a36c0
Author: Felix Nguyen <[email protected]>
AuthorDate: Fri Jun 5 15:40:24 2026 +0700
HDFS-17930. [ARR] Router shutdown should not shut
routerAsyncResponderExecutor down (#8527)
Signed-off-by: Cheng Pan <[email protected]>
---
.../server/federation/router/RouterRpcServer.java | 3 ---
.../async/TestRouterAsyncHandlerQueueOverflow.java | 28 +++++++++++++---------
2 files changed, 17 insertions(+), 14 deletions(-)
diff --git
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java
index aff3d4b9d59..f5a186acdfd 100644
---
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java
+++
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java
@@ -724,9 +724,6 @@ protected void serviceStop() throws Exception {
if (routerDefaultAsyncHandlerExecutor != null) {
routerDefaultAsyncHandlerExecutor.shutdownNow();
}
- if (routerAsyncResponderExecutor != null) {
- routerAsyncResponderExecutor.shutdownNow();
- }
super.serviceStop();
}
diff --git
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/async/TestRouterAsyncHandlerQueueOverflow.java
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/async/TestRouterAsyncHandlerQueueOverflow.java
index 556423f87b1..0d5057e071f 100644
---
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/async/TestRouterAsyncHandlerQueueOverflow.java
+++
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/async/TestRouterAsyncHandlerQueueOverflow.java
@@ -104,21 +104,27 @@ public static void setUpCluster() throws Exception {
cluster.waitNamenodeRegistration();
cluster.waitActiveNamespaces();
- testLatch = new CountDownLatch(1);
ns0 = cluster.getNameservices().get(0);
MiniRouterDFSCluster.NamenodeContext nn0 = cluster.getNamenode(ns0, null);
FSNamesystem spyNamesystem =
NameNodeAdapterMockitoUtil.spyOnNamesystem(nn0.getNamenode());
// Mock one slow operation. Any public interface from FSNamesystem will do.
- Mockito.doAnswer(invocationOnMock -> {
- String invokePath = invocationOnMock.getArgument(1);
- if (invokePath.startsWith("/veryBigOperation")) {
- testLatch.await();
- } else {
- return invocationOnMock.callRealMethod();
- }
- return null;
- }).when(spyNamesystem).getFilesBlockingDecom(anyLong(), anyString());
+ spyNamesystem.writeLock();
+ Mockito.when(spyNamesystem.getFilesBlockingDecom(anyLong(), anyString()))
+ .thenAnswer(invocationOnMock -> {
+ if (testLatch == null) {
+ return null;
+ }
+ String invokePath = invocationOnMock.getArgument(1);
+ if (invokePath.startsWith("/veryBigOperation")) {
+ testLatch.await();
+ } else {
+ return invocationOnMock.callRealMethod();
+ }
+ return null;
+ });
+ spyNamesystem.writeUnlock();
+ testLatch = new CountDownLatch(1);
MiniRouterDFSCluster.RouterContext router = cluster.getRandomRouter();
routerRpcServer = router.getRouterRpcServer();
routerRpcServer.initAsyncThreadPools(routerConf);
@@ -169,7 +175,7 @@ public void testInvokeMethodQueueOverflow() throws
Exception {
// Queue full, rejected
asyncRpcClient.invokeMethod(ugi, namenodes, true, protocol,
method.getMethod(), params);
assertEquals(2, nsExecutor.getQueue().size());
- String expectedMsg = "Namespace '" + ns0 + "' is overloaded (queue size: "
+ QUEUE_CAP + ")";
+ String expectedMsg = "Namespace '" + ns0 + "' async handler is busy.";
LambdaTestUtils.intercept(StandbyException.class, expectedMsg,
() -> syncReturn(FileStatus.class));
// Unstuck the namenode so we can terminate this test
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]