Skip to content

Commit f8a44ff

Browse files
authored
[Bug][Master] send ACK event timeout (#15346)
1 parent ce11674 commit f8a44ff

3 files changed

Lines changed: 20 additions & 11 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
44
![codecov](https://codecov.io/gh/apache/dolphinscheduler/branch/dev/graph/badge.svg)
55
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=apache-dolphinscheduler&metric=alert_status)](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler)
6-
[![Twitter Follow](https://img.shields.io/twitter/follow/dolphinschedule.svg?style=social&label=Follow)](https://twitter.com/dolphinschedule)
6+
[![Twitter Follow](https://img.shields.io/twitter/follow/dolphinschedule.svg?style=social&label=Follow)](https://twitter.com/dolphinschedule) <!-- markdown-link-check-disable-line -->
77
[![Slack Status](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social)](https://s.apache.org/dolphinscheduler-slack)
88
[![CN doc](https://img.shields.io/badge/文档-中文版-blue.svg)](README_zh_CN.md)
99

@@ -65,7 +65,7 @@ find the good first issue in [here](https://github.com/apache/dolphinscheduler/c
6565
Welcome to join the Apache DolphinScheduler community by:
6666

6767
- Join the [DolphinScheduler Slack](https://s.apache.org/dolphinscheduler-slack) to keep in touch with the community
68-
- Follow the [DolphinScheduler Twitter](https://twitter.com/dolphinschedule) and get the latest news
68+
- Follow the [DolphinScheduler Twitter](https://twitter.com/dolphinschedule) and get the latest news <!-- markdown-link-check-disable-line -->
6969
- Subscribe DolphinScheduler mail list, users@dolphinscheduler.apache.org for user and dev@dolphinscheduler.apache.org for developer
7070

7171
# Landscapes
@@ -75,5 +75,4 @@ Welcome to join the Apache DolphinScheduler community by:
7575
<img src="https://landscape.cncf.io/images/left-logo.svg" width="150"/>&nbsp;&nbsp;<img src="https://landscape.cncf.io/images/right-logo.svg" width="200"/>
7676
<br/><br/>
7777
DolphinScheduler enriches the <a href="https://landscape.cncf.io/?landscape=observability-and-analysis&license=apache-license-2-0">CNCF CLOUD NATIVE Landscape.</a >
78-
7978
</p >

‎README_zh_CN.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
44
[![codecov](https://codecov.io/gh/apache/dolphinscheduler/branch/dev/graph/badge.svg)]()
55
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=apache-dolphinscheduler&metric=alert_status)](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler)
6-
[![Twitter Follow](https://img.shields.io/twitter/follow/dolphinschedule.svg?style=social&label=Follow)](https://twitter.com/dolphinschedule)
6+
[![Twitter Follow](https://img.shields.io/twitter/follow/dolphinschedule.svg?style=social&label=Follow)](https://twitter.com/dolphinschedule) <!-- markdown-link-check-disable-line -->
77
[![Slack Status](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social)](https://s.apache.org/dolphinscheduler-slack)
88
[![EN doc](https://img.shields.io/badge/document-English-blue.svg)](README.md)
99

@@ -61,7 +61,7 @@ DolphinScheduler 的主要特��如下:
6161
欢迎通过以方式加入社区:
6262

6363
- 加入 [DolphinScheduler Slack](https://s.apache.org/dolphinscheduler-slack)
64-
- 关注 [DolphinScheduler Twitter](https://twitter.com/dolphinschedule) 来获取最新消息
64+
- 关注 [DolphinScheduler Twitter](https://twitter.com/dolphinschedule) 来获取最新消息 <!-- markdown-link-check-disable-line -->
6565
- 订阅 DolphinScheduler 邮件列表, 用户订阅 users@dolphinscheduler.apache.org 开发者请订阅 dev@dolphinscheduler.apache.org
6666

6767
# Landscapes

‎dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/event/TaskResultEventHandler.java‎

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@
3535

3636
import java.util.Optional;
3737

38+
import lombok.extern.slf4j.Slf4j;
39+
3840
import org.springframework.beans.factory.annotation.Autowired;
3941
import org.springframework.stereotype.Component;
4042

4143
@Component
44+
@Slf4j
4245
public class TaskResultEventHandler implements TaskEventHandler {
4346

4447
@Autowired
@@ -99,11 +102,13 @@ public void handleTaskEvent(TaskEvent taskEvent) throws TaskEventHandleError, Ta
99102
taskInstance.setVarPool(taskEvent.getVarPool());
100103
processService.changeOutParam(taskInstance);
101104
taskInstanceDao.updateById(taskInstance);
102-
sendAckToWorker(taskEvent);
103105
} catch (Exception ex) {
104106
TaskInstanceUtils.copyTaskInstance(oldTaskInstance, taskInstance);
105107
throw new TaskEventHandleError("Handle task result event error, save taskInstance to db error", ex);
106108
}
109+
110+
sendAckToWorker(taskEvent);
111+
107112
TaskStateEvent stateEvent = TaskStateEvent.builder()
108113
.processInstanceId(taskEvent.getProcessInstanceId())
109114
.taskInstanceId(taskEvent.getTaskInstanceId())
@@ -115,11 +120,16 @@ public void handleTaskEvent(TaskEvent taskEvent) throws TaskEventHandleError, Ta
115120
}
116121

117122
public void sendAckToWorker(TaskEvent taskEvent) {
118-
ITaskInstanceExecutionEventAckListener instanceExecutionEventAckListener =
119-
SingletonJdkDynamicRpcClientProxyFactory
120-
.getProxyClient(taskEvent.getWorkerAddress(), ITaskInstanceExecutionEventAckListener.class);
121-
instanceExecutionEventAckListener.handleTaskInstanceExecutionFinishEventAck(
122-
TaskInstanceExecutionFinishEventAck.success(taskEvent.getTaskInstanceId()));
123+
try {
124+
ITaskInstanceExecutionEventAckListener instanceExecutionEventAckListener =
125+
SingletonJdkDynamicRpcClientProxyFactory
126+
.getProxyClient(taskEvent.getWorkerAddress(), ITaskInstanceExecutionEventAckListener.class);
127+
instanceExecutionEventAckListener.handleTaskInstanceExecutionFinishEventAck(
128+
TaskInstanceExecutionFinishEventAck.success(taskEvent.getTaskInstanceId()));
129+
} catch (Exception e) {
130+
// master ignore the exception, worker will retry to send this TaskEventType.RESULT event again.
131+
log.warn("send ack to worker error, taskInstanceId: {}", taskEvent.getTaskInstanceId(), e);
132+
}
123133
}
124134

125135
@Override

0 commit comments

Comments
 (0)