-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add Task#Retrier incremental backoff and Wait#Timestamp #100
Conversation
update:
update:
|
update:
|
399e1e1
to
632d71f
Compare
update:
|
2540987
to
59c6ddd
Compare
Updates:
|
Can you describe the problem you are trying to solve in the OP? It;'s hard to understand what problem/feature this is trying to solve. Saw the little refs in the OP - are those new features being added here? |
update:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM just needs a rebase
Checked commits kbrock/floe@7d3af17~...5eff318 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint |
Added - Add Fail#CausePath and Fail#ErrorPath (#110) - Add Task#Retrier incremental backoff and Wait#Timestamp (#100) Fixed - Combine stdout and stderr for docker and podman runners (#104) - Don't raise an exception on task failure (#115) - Fix task output handling (#112) - Fix Context#input not JSON parsed (#122)
Change Wait#running?
I feel
running?
should read the state to see if the task is complete but should not change the state.This change was also introduced to be reusable by
Task#wait
.Before
running?
checks if we have passed the amount of time necessary. Once it is no longer running, this method sets thestate["EndTime"]
.After
start
sets the target time when this will end.running?
just checksTime.now
agains the predefined value.running?
no longer modifiesstate
sleep
orMiqQueue#deliver_on
.Wait#SecondsPath
wait refThe existing
Seconds
parameter reads the wait time out of the payload.The new
SecondsPath
reads the wait time out of theinput
.Wait#Timestamp
,Wait#TimestampPath
While the existing
Seconds
parameter is a delta, and the newTimestamp
parameter is an absolute time.The
TimestampPath
parameter is the equivalent, but the value comes from theinput
.The implementation for
Timestamp
andTimestampPayload
are not very different fromSeconds
. wait refTask#retry
A retrier specifies how many times to re-run a Task after it fails.
But the current code does not delay the retry. More information on the retry delay logic can be found in the ref
Before
A task retry does not introduce a delay so there is no incremental backoff.
The retrier does allow you to define it, but it is not used.
You will notice the
TODO
removed from this PR.After
We do a non-blocking sleep similar to
Wait
when a task has a failure.Since the
Task#wait
implementation is based uponSleep#wait
, I bundled them together.Removed
Extracted
workflow#wait_until
to another PR.