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

Failure Policy: Adds FailurePolicy API field to Job #48

Closed
wants to merge 7 commits into from

Conversation

JoshVanL
Copy link
Collaborator

@JoshVanL JoshVanL commented Oct 4, 2024

Based of dapr/proposals#66

Adds a FailurePolicy option to the Job API to allow re-triggering
job which are marked as failed by the caller. Adds two types of policy;
Drop and Constant. Drop has no retry policy, Constant will
constantly retry the job trigger for a configurable delay, up to a
configurable maximum number of retries (which could be infinite).

Note that the failure policy retry cadence has no effect on the actual
Job schedule, meaning if a job was to be retired and eventually
succeeded, the Job would continue to trigger at the origin configured
schedule.

By default, all Jobs will have a Constant policy with a delay of 1s and 3 max retries.

Adds a new `List` API to the cron service. This API returns the list of
current committed active jobs that have a name matching the given
prefix. An empty prefix will return all jobs.

```go
List(ctx context.Context, prefix string) (*ListResponse, error)
```

A new `ListResponse` proto message has been added which contains a list
of named Jobs.

As part of this change to clean up the codebase, the cron API definition
has been moved into `api/api.go`. A new `queue` runnable has been
created which is responsible for managing the underlying job queue based
on events from the informer. A new `internal/api` package is responsible
for implementing the server CRUD APIs.

Uses dapr/kit concurrency/map from dapr/kit#104

Signed-off-by: joshvanl <[email protected]>
Signed-off-by: joshvanl <[email protected]>
Separates internal "stored" API into `/internal/api/stored`, and keep
consumable "api" API in `/api` package. Names the proto files into
appropriate package names and changes the `proto` dir structure
accordingly.

Branch based off diagridio#41 and
diagridio#43

Signed-off-by: joshvanl <[email protected]>
Based of dapr/proposals#66

Adds a `FailurePolicy` option to the `Job` API to allow re-triggering
job which are marked as failed by the caller. Adds two types of policy;
`Drop` and `Constant`. `Drop` has no retry policy, `Constant` will
constantly retry the job trigger for a configurable delay, up to a
configurable maximum number of retries (which could be infinite).

Note that the failure policy retry cadence has no effect on the actual
Job schedule, meaning if a job was to be retired and eventually
succeeded, the Job would continue to trigger at the origin configured
schedule.

By default, all Jobs will have a `Constant` policy with a delay of 1s.

Signed-off-by: joshvanl <[email protected]>
@JoshVanL JoshVanL marked this pull request as draft October 4, 2024 19:33
@JoshVanL
Copy link
Collaborator Author

Superseded by #52

@JoshVanL JoshVanL closed this Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant