Skip to content

Commit 078ce98

Browse files
committed
fix: Bounded IO 线程池拒绝策略修正
修正Bounded IO 线程池在等待新任务加入被中断时,抛出 Reject 异常
1 parent 5fef461 commit 078ce98

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.qcloud.cos</groupId>
88
<artifactId>hadoop-cos</artifactId>
9-
<version>5.9.1</version>
9+
<version>5.9.2</version>
1010
<packaging>jar</packaging>
1111

1212
<name>Apache Hadoop Tencent Qcloud COS Support</name>

src/main/java/org/apache/hadoop/fs/CosFileSystem.java

+5
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,12 @@ public void rejectedExecution(Runnable r,
141141
} catch (InterruptedException e) {
142142
LOG.error("put a io task into the download " +
143143
"thread pool occurs an exception.", e);
144+
throw new RejectedExecutionException(
145+
"Putting the io task failed due to the interruption", e);
144146
}
147+
} else {
148+
LOG.error("The bounded io thread pool has been shutdown.");
149+
throw new RejectedExecutionException("The bounded io thread pool has been shutdown");
145150
}
146151
}
147152
}

src/main/java/org/apache/hadoop/fs/CosNConfigKeys.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@InterfaceStability.Unstable
1111
public class CosNConfigKeys extends CommonConfigurationKeys {
1212
public static final String USER_AGENT = "fs.cosn.user.agent";
13-
public static final String DEFAULT_USER_AGENT = "cos-hadoop-plugin-v5.9.1";
13+
public static final String DEFAULT_USER_AGENT = "cos-hadoop-plugin-v5.9.2";
1414

1515
public static final String TENCENT_EMR_VERSION_KEY = "fs.emr.version";
1616

0 commit comments

Comments
 (0)