This is an automated email from the ASF dual-hosted git repository.
lizhimins pushed a commit to branch rocketmq-studio
in repository https://gitbox.apache.org/repos/asf/rocketmq-dashboard.git
The following commit(s) were added to refs/heads/rocketmq-studio by this push:
new 6158e432 fix(aliyun): cancel timed out OpenAPI calls (#1398)
6158e432 is described below
commit 6158e4321b572b818df3d0baffb6b0480e9037d4
Author: aias00 <[email protected]>
AuthorDate: Mon Aug 10 20:44:49 2026 +0800
fix(aliyun): cancel timed out OpenAPI calls (#1398)
(cherry picked from commit ef3994c5727d9c3716c2518384ebfeb882ae1394)
Signed-off-by: liuhy <[email protected]>
---
.../apache/rocketmq/studio/provider/alibaba/AliyunClientFactory.java | 1 +
.../rocketmq/studio/provider/alibaba/AliyunClientFactoryTest.java | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git
a/server/src/main/java/org/apache/rocketmq/studio/provider/alibaba/AliyunClientFactory.java
b/server/src/main/java/org/apache/rocketmq/studio/provider/alibaba/AliyunClientFactory.java
index 2ad610fb..3e56b467 100644
---
a/server/src/main/java/org/apache/rocketmq/studio/provider/alibaba/AliyunClientFactory.java
+++
b/server/src/main/java/org/apache/rocketmq/studio/provider/alibaba/AliyunClientFactory.java
@@ -92,6 +92,7 @@ public class AliyunClientFactory {
try {
return future.get(callTimeoutSeconds, TimeUnit.SECONDS);
} catch (TimeoutException ex) {
+ future.cancel(true);
throw new BusinessException(504,
"Aliyun OpenAPI request timed out after " +
callTimeoutSeconds + " seconds");
} catch (InterruptedException ex) {
diff --git
a/server/src/test/java/org/apache/rocketmq/studio/provider/alibaba/AliyunClientFactoryTest.java
b/server/src/test/java/org/apache/rocketmq/studio/provider/alibaba/AliyunClientFactoryTest.java
index 2923df24..0eaed03d 100644
---
a/server/src/test/java/org/apache/rocketmq/studio/provider/alibaba/AliyunClientFactoryTest.java
+++
b/server/src/test/java/org/apache/rocketmq/studio/provider/alibaba/AliyunClientFactoryTest.java
@@ -117,12 +117,14 @@ class AliyunClientFactoryTest {
factory.setCallTimeoutSeconds(1L);
AliyunClientFactory spy = Mockito.spy(factory);
doReturn(asyncClient).when(spy).client(anyString(), anyString());
+ CompletableFuture<Object> future = new CompletableFuture<>();
assertThatThrownBy(() -> spy.call(CREDENTIAL_ID, REGION,
- client -> new CompletableFuture<>()))
+ client -> future))
.isInstanceOf(BusinessException.class)
.extracting("code")
.isEqualTo(504);
+ assertThat(future).isCancelled();
}
@Test