-
Notifications
You must be signed in to change notification settings - Fork 209
TODO: dapr workflow purge
#1550
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
Conversation
Adds `dapr scheduler list` which a new CLI command to list the jobs
which are in scheduler. Lists both app Jobs and actor reminders. Works
for both standalone and Kubernetes modes.
The jobs can be filtered by namespace with `-n ...`, as well as by job
target type `--filter-type={all, job, actorreminder}`. Defaults to all.
Supports output formats (`-o`) `short`, `wide`, `json` and `yaml`.
Defaults to `short`. `json` and `yaml` output formats are _not_
importable formats.
Fixes the table output prints to remove empty space at the start of
rows.
Adds e2e standalone tests for this new command.
```
$ dapr scheduler list
NAMESPACE APP ID NAME TARGET BEGIN COUNT LAST TRIGGER
default 275c7268-9011-4796-8b06-1ed53358eebf test1 job 2025-09-18T01:06:28Z 170 2025-09-18T01:09:18Z
default 275c7268-9011-4796-8b06-1ed53358eebf test2 job 2025-09-18T02:06:28Z 0
```
Signed-off-by: joshvanl <[email protected]>
Signed-off-by: joshvanl <[email protected]>
Signed-off-by: joshvanl <[email protected]>
Signed-off-by: joshvanl <[email protected]>
Signed-off-by: joshvanl <[email protected]>
Signed-off-by: joshvanl <[email protected]>
Adds `dapr scheduler delete` which is a new CLI command to delete jobs and actor reminders which are stored in scheduler. You can delete multiple jobs at a time, or all jobs registered in a namespace. The target namespace is required. The given name encode the job target type in the string: ``` "job/<app-id>/<job-name>" for jobs "actorreinder/<actor-type>||<actor-id>||<reminder-name>" for actor reminders ``` ``` dapr delete -n foo job/foo/bar dapr delete -n foo actorreminder/MyActor||1234||reminder1 dapr delete -n foo --delete-all-yes-i-know-what-i-am-doing ``` Signed-off-by: joshvanl <[email protected]>
Adds a `dapr scheduler export` command to export the current scheduler state to a file, and a `dapr scheduler import` command to import a previously exported scheduler state from a file. This is useful for backing up and restoring the scheduler state. ``` dapr scheduler export --output-file scheduler_backup.bin dapr scheduler import --input-file scheduler_backup.bin ``` Signed-off-by: joshvanl <[email protected]>
Adds a `dapr workflow list` command to list all workflows for an app ID which are currently in the system. The target app ID is required. The workflows can be filtered by either workflow name, and/or the workflow status `--filter-workflow=foo`, `--filter-status=FAILED`. Supports output formats (`-o`) `short`, `wide`, `json` and `yaml`. Defaults to `short`. `json` and `yaml` output formats are _not_ importable formats. Works by getting the correct SQL driver based on the actor state store which is fetched. The user will then need to supply the SQL connection string. Redis and mongodb actor state stores are currently not supported. In future, this listing should exist in the runtime and executed by daprd. This would mean the user would _not_ need to likely port-forward to their actor state store db, and supply a connection string. This should be prioritized for 1.17. ``` $ dapr workflow list -c file:/tmp/Test_Integrationdaprdworkflowrecordsactivity12498617344/001/test-data.db --sql-table-name inttest --app-id 152683e5-ba30-484d-b227-1895f5f1f92d dapr client initializing for: 127.0.0.1:1034 NAMESPACE APP ID WORKFLOW INSTANCE ID CREATED STATUS default 152683e5-ba30-484d-b227-1895f5f1f92d xyz c4f764c0-4584-4b1f-ad22-661f12058e14 2025-09-21T01:38:32.726062016Z RUNNING default 152683e5-ba30-484d-b227-1895f5f1f92d records cf0d5210-d9f2-4f45-ac33-67c8f3f4cf43 2025-09-21T01:38:29.676488461Z COMPLETED default 152683e5-ba30-484d-b227-1895f5f1f92d bar e3db559a-5934-44d8-a2ae-4b0501d06e59 2025-09-21T01:38:32.716533938Z FAILED ``` ``` $ dapr workflow list -c file:/tmp/Test_Integrationdaprdworkflowrecordsactivity12498617344/001/test-data.db --sql-table-name inttest --app-id 152683e5-ba30-484d-b227-1895f5f1f92d -o wide dapr client initializing for: 127.0.0.1:1034 NAMESPACE APP ID WORKFLOW INSTANCE ID CREATED LAST UPDATE STATUS CUSTOM STATUS FAILURE MESSAGE FAILURE TYPE default 152683e5-ba30-484d-b227-1895f5f1f92d xyz c4f764c0-4584-4b1f-ad22-661f12058e14 2025-09-21T01:38:32.726062016Z 2025-09-21T01:38:32.73093843Z RUNNING custom-3 default 152683e5-ba30-484d-b227-1895f5f1f92d records cf0d5210-d9f2-4f45-ac33-67c8f3f4cf43 2025-09-21T01:38:29.676488461Z 2025-09-21T01:38:32.711796608Z COMPLETED custom-1 default 152683e5-ba30-484d-b227-1895f5f1f92d bar e3db559a-5934-44d8-a2ae-4b0501d06e59 2025-09-21T01:38:32.716533938Z 2025-09-21T01:38:32.724251959Z FAILED custom-2 failed *errors.errorString ``` Signed-off-by: joshvanl <[email protected]>
Signed-off-by: joshvanl <[email protected]>
Signed-off-by: joshvanl <[email protected]>
Signed-off-by: joshvanl <[email protected]>
|
@JoshVanL Could there be a flag here that purges any corresponding reminders from the scheduler store? For example, if a user says purge instance 123, then it will also purge corresponding reminders. Also if user says purge all failed workflows, could it also attempt to purge corresponding reminders? |
|
@olitomlinson great suggestion, will add! |
|
As discussed on Discord with @JoshVanL , we should be able to support the following scenario :
Understandably, this option could cause corrupted state if it was used incorrectly. Because of this a |
|
Closed in favor of #1560 |
No description provided.