-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancement(flow): add heartbeat for flow task #2468
Conversation
server/odc-service/src/main/java/com/oceanbase/odc/metadb/task/TaskRepository.java
Show resolved
Hide resolved
.../odc-service/src/main/java/com/oceanbase/odc/service/flow/task/model/FlowTaskProperties.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see the initial value of lastHeartbeatTime while task started, what is the behavior if lastHeatbeatTime is null ?
added, we will update heartbeat before task instance's status is updated to 'EXECUTING' try {
flowTaskInstance = getFlowTaskInstance(flowInstanceId, activityId);
BaseRuntimeFlowableDelegate<?> delegate = getDelegateInstance(flowTaskInstance);
// we init heartbeat time here
delegate.updateHeartbeatTime();
List<Class<? extends ExecutionListener>> list = delegate.getExecutionListenerClasses();
if (CollectionUtils.isNotEmpty(list)) {
// we update flow task instance's status here, 'CREATED' -> 'EXECUTING'
list.forEach(c -> doCallListener(FlowConstants.EXECUTION_START_EVENT_NAME, executionFacade, c));
}
delegate.execute(executionFacade);
...
} catch (Exception e) {
...
} finally {
...
} |
…t/shanlu_add_heartbeat_for_flow_task
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
server/odc-service/src/main/java/com/oceanbase/odc/service/flow/FlowSchedules.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What type of PR is this?
type-enhancement
What this PR does / why we need it:
ticket's status will not be changed when the odc node is crashed and there are flow task instance running on it and the user will find that the ticket will keep 'RUNNING' status without any changes.
I use heartbeat to solve this problem, the ticket will be cancelled if the related heartbeat is timeout
Which issue(s) this PR fixes:
Fixes #2476
Special notes for your reviewer:
Additional documentation e.g., usage docs, etc.: