-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
[BACK-2633] soft failure when running dexcom tasks #656
Conversation
dexcom/fetch/runner.go
Outdated
if taskRunner, tErr := NewTaskRunner(r, tsk); tErr != nil { | ||
tsk.AppendError(errors.Wrap(tErr, "unable to create task runner")) | ||
ErrorOrRetryTask(tsk, errors.Wrap(tErr, "unable to create task runner")) |
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.
If this block is executed, this means that there is bug in the code. It's better not to fail the task here, but keep on retrying (until the bug is eventually fixed).
} else if tErr = taskRunner.Run(ctx); tErr != nil { | ||
tsk.AppendError(errors.Wrap(tErr, "unable to run task runner")) | ||
ErrorOrRetryTask(tsk, errors.Wrap(tErr, "unable to run task runner")) |
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.
I think this is the only place where we should fail the task if retries are exceeded.
} else if tErr = taskRunner.Run(ctx); tErr != nil { | ||
tsk.AppendError(errors.Wrap(tErr, "unable to run task runner")) | ||
ErrorOrRetryTask(tsk, errors.Wrap(tErr, "unable to run task runner")) |
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.
We should log the error here, otherwise we won't know why a task has been retried.
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.
the error is logged when we fail the task originally not all errors caused a task failure within taskRunner.Run
dexcom/fetch/runner.go
Outdated
|
||
if serverSessionToken, sErr := r.AuthClient().ServerSessionToken(); sErr != nil { | ||
tsk.AppendError(errors.Wrap(sErr, "unable to get server session token")) | ||
ErrorOrRetryTask(tsk, errors.Wrap(sErr, "unable to get server session token")) |
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.
We shouldn't fail the task if we can't obtain a session token from our authentication service, otherwise we'll fail all tasks if the auth service is down for whatever reason. Retries should be unlimited too.
only error / retry when running the task
/deploy qa1 task |
jh-bate updated values.yaml file in qa1 |
jh-bate updated flux policies file in qa1 |
jh-bate deployed platform dexcom-soft-failure branch to qa1 namespace |
if ok { | ||
count++ | ||
t.Data[dexcomTaskRetryField] = count | ||
} |
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.
Is it worth resetting this to 1 if it's not an int?
changes were made and has now been reviewed by others
/deploy qa2 task |
jh-bate updated values.yaml file in qa2 |
jh-bate updated flux policies file in qa2 |
jh-bate deployed platform dexcom-soft-failure branch to qa2 namespace |
Allow "soft failure" for dexcom task runner
FYI context from Darin: