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

Trigger Response Undeliverable #53

Merged
merged 4 commits into from
Oct 15, 2024

Conversation

JoshVanL
Copy link
Collaborator

Adds a public API TriggerResponse proto message which is now returned
from the Trigger function call. This message contains a Result enum
which encompasses signalling the existing SUCCESS and FAILURE job
trigger results, as well as a new UNDELIVERABLE result.

It can be the case that a job hasn't necessarily failed, but it actually
just can't be delivered to the target at this time. To prevent the Job
going into a failure loop, receiving the UNDELIVERABLE result will put
the job into a new "staging" queue. This puts the job into a holding
pattern until it can be delivered.

The consumer can use the new DeliverablePrefixes call to register the
set of prefixes whose matching job names can be delivered. The returned
CancelFunc is used to de-register this prefix. Prefixes are registered
as a pool in that multiple identical prefixes can be registered and
which will remain active until all are de-registered via cancellation.

@JoshVanL JoshVanL marked this pull request as draft October 14, 2024 16:42
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]>
Signed-off-by: joshvanl <[email protected]>
Adds a public API `TriggerResponse` proto message which is now returned
from the Trigger function call. This message contains a Result enum
which encompasses signalling the existing SUCCESS and FAILURE job
trigger results, as well as a new UNDELIVERABLE result.

It can be the case that a job hasn't necessarily failed, but it actually
just can't be delivered to the target at this time. To prevent the Job
going into a failure loop, receiving the `UNDELIVERABLE` result will put
the job into a new "staging" queue. This puts the job into a holding
pattern until it can be delivered.

The consumer can use the new `DeliverablePrefixes` call to register the
set of prefixes whose matching job names can be delivered. The returned
`CancelFunc` is used to de-register this prefix. Prefixes are registered
as a pool in that multiple identical prefixes can be registered and
which will remain active until all are de-registered via cancellation.

Signed-off-by: joshvanl <[email protected]>
@JoshVanL JoshVanL force-pushed the queue-staging-undeliverable-2 branch from 3750e07 to aabed73 Compare October 15, 2024 12:33
@JoshVanL JoshVanL marked this pull request as ready for review October 15, 2024 12:35
Copy link
Collaborator

@cicoyle cicoyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was beefy. couldn't find anything. nice job 🎉

@JoshVanL JoshVanL merged commit 679ef35 into diagridio:master Oct 15, 2024
1 check passed
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.

2 participants