ruanwenjun commented on code in PR #18736:
URL:
https://github.com/apache/dolphinscheduler/pull/18736#discussion_r4439389958
##########
dolphinscheduler-task-executor/src/main/java/org/apache/dolphinscheduler/task/executor/eventbus/TaskExecutorEventBusCoordinator.java:
##########
@@ -193,6 +193,11 @@ private void doFireTaskExecutorEventBus(final
ITaskExecutor taskExecutor) {
JSONUtils.toJsonString(taskExecutorLifecycleEvent));
} catch (Exception e) {
log.error("Fire TaskExecutorLifecycleEvent: {} error",
taskExecutorLifecycleEvent, e);
+ if (taskExecutorLifecycleEvent.getType().isFinished()
+ &&
taskExecutorRepository.contains(taskExecutor.getId())) {
+ // The worker has stopped tracking; retain the original
result until the listener can finalize it.
+ taskExecutorEventBus.publish(headEventOptional.get());
+ }
Review Comment:
The logic here seems strange—the event shouldn’t be executed repeatedly, as
this can easily lead to memory leaks. If you’re concerned about the event being
rejected, you should remove the rejection logic from
`reportTaskExecutorLifecycleEvent`. I’m actually not sure why
`reportTaskExecutorLifecycleEvent` needs to throw an exception, or why a retry
is necessary here. Could you explain the issue here using a sequence diagram or
some other method?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]