Skip to content
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

feat: Add suspend API to safely delete scheduled tasks after execution is complete #5948

Open
injae-kim opened this issue Sep 23, 2024 · 1 comment
Labels
for/team-attention For team attention

Comments

@injae-kim
Copy link

Problem description:

Hi! currently we migrate batch system to spring-cloud-dataflow.

SCDF doesn't support to update cronjob, workaround is to delete&re-create schedule (issue)

We use many scheduled tasks on spring-cloud-dataflow and I found that scheduled task doesn't support update.
And I found that update cronJob is not recommended by k8s side too (issue, issue2)

But, we need some way to update (or, at least suspend) scheduled tasks on below case.

  1. Register scheduled task with app v1
  2. ✅ After we deploy new app v2, need to suspend(not delete immediately, wait until complete) scheduled tasks v1 and re-create with v2

We want to safe-delete scheduled task v1 after complete to run cronJob that currently running, so need suspend instead of delete (which immediately delete cronJob)

Solution description:

// SCDF SchdulerService
public void suspend(..) {
  ..
}       

Add suspend API on DefaultSchedulerService and KubernetesScheduler.

// CronJobSpec
    public void setSuspend(Boolean suspend) {
        this.suspend = suspend;
    }

Then we can suspend v1 scheduled task by setSuspend on CronJobSpec.

Description of alternatives:

We want to safe-delete(delete after complete to run cronJob that currently running), so we can't use delete and need suspend or update.

But update is not recommended on k8s side so suspend API is proper solution I think!

Additional context:

X

@github-actions github-actions bot added the status/need-triage Team needs to triage and take a first look label Sep 23, 2024
@injae-kim
Copy link
Author

We need this suspend API now for our service! PTAL 🙇

If you think this issue is not resolved soon, please tell me~ I'll create PR!

@injae-kim injae-kim changed the title feat: Add suspend API for scheduled tasks feat: Add suspend API to safely delete scheduled tasks after complete to run Sep 23, 2024
@injae-kim injae-kim changed the title feat: Add suspend API to safely delete scheduled tasks after complete to run feat: Add suspend API to safely delete scheduled tasks after execution is complete Sep 23, 2024
@cppwfs cppwfs added for/team-attention For team attention and removed status/need-triage Team needs to triage and take a first look labels Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for/team-attention For team attention
Projects
None yet
Development

No branches or pull requests

2 participants