dolphinscheduler icon indicating copy to clipboard operation
dolphinscheduler copied to clipboard

Timed task self dependence | 定时任务自我依赖

Open RunningHu opened this issue 5 years ago • 11 comments

When DS starts a scheduled task, if the last task is not finished, how can it be set not to start it again, or to kill the task that was not finished in the last schedule.

For example: the task started yesterday, the task has been running without ending, and today it's time again. If you didn't finish the last time, you shouldn't get up this time, or you should get rid of what you didn't finish last time.

ds定时调度启动任务的时候,如果上一次的任务没有执行完,怎么设置不让他再次启动,或者干掉上次调度没有运行完的任务。 比如:昨天起了任务,这个任务一直跑着没有结束,今天又到时间了,上次没跑完,这次就不该起来,或者应该应该把上次没跑完的干掉。

RunningHu avatar Jan 06 '21 04:01 RunningHu

You can choose the timeout failure strategy.

By the way, for better communication, please use English,

CalvinKirs avatar Jan 06 '21 04:01 CalvinKirs

这个地方可以改造 worker。给task添加一个阻塞策略:并行执行 丢弃后续调度 改造方案:在worker初始化 AbstractTask 的时候,判断下相同工作流、task_type、task_name 是否有运行的task实例。如果存在 ,判断是否是自己,否则 中断执行,将task实例的状态标记为失败返回。

hujiang75277381 avatar Jan 06 '21 06:01 hujiang75277381

It’s best to leave this strategy to the user to decide, such as -Start a new task (regardless of the previous task) -End the previous task and start a new task -Wait for the completion of the previous task and start a new task (the next scheduling time point)


最好这个策略交给用户决定,比如

  • 启动新任务(不管上一个任务)
  • 结束上一个任务,启动新任务
  • 等待上一个任务结束后,启动新任务(下一个调度时间点)

vimacro avatar Jan 06 '21 06:01 vimacro

You can choose the timeout failure strategy.

By the way, for better communication, please use English,

English +1,please add title and desc in English

davidzollo avatar Jan 06 '21 06:01 davidzollo

It’s best to leave this strategy to the user to decide, such as -Start a new task (regardless of the previous task) -End the previous task and start a new task -Wait for the completion of the previous task and start a new task (the next scheduling time point)

最好这个策略交给用户决定,比如

  • 启动新任务(不管上一个任务)
  • 结束上一个任务,启动新任务
  • 等待上一个任务结束后,启动新任务(下一个调度时间点)

+1, I agree

brave-lee avatar Jan 06 '21 06:01 brave-lee

It’s best to leave this strategy to the user to decide, such as -Start a new task (regardless of the previous task) -End the previous task and start a new task -Wait for the completion of the previous task and start a new task (the next scheduling time point)

最好这个策略交给用户决定,比如

  • 启动新任务(不管上一个任务)
  • 结束上一个任务,启动新任务
  • 等待上一个任务结束后,启动新任务(下一个调度时间点)

这样是最好的方案

RunningHu avatar Jan 06 '21 07:01 RunningHu

English

chinese

hujiang75277381 avatar Jan 07 '21 01:01 hujiang75277381

It’s best to leave this strategy to the user to decide, such as -Start a new task (regardless of the previous task) -End the previous task and start a new task -Wait for the completion of the previous task and start a new task (the next scheduling time point)

最好这个策略交给用户决定,比如

  • 启动新任务(不管上一个任务)
  • 结束上一个任务,启动新任务
  • 等待上一个任务结束后,启动新任务(下一个调度时间点)

I think this is aceptable but user need to handle checking if job had proccess instances running or not, is this right ?

brucemen711 avatar Jan 07 '21 09:01 brucemen711

image I create this flow to make job run every hour, hope it helps. You can even run every 10 minutes just in case previous schudule not done and next schedule not run cause checkpoint exists.

brucemen711 avatar Jan 28 '21 09:01 brucemen711

When can this function be realized

leeseven1211 avatar Mar 01 '21 01:03 leeseven1211

dev branch has implemented this feature, please check

davidzollo avatar Jan 04 '22 07:01 davidzollo