-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
feat: maxRetryDelay option to limit retryBackoff #531
base: master
Are you sure you want to change the base?
Conversation
expire_seconds = COALESCE($6, expire_seconds), | ||
retention_minutes = COALESCE($7, retention_minutes), | ||
dead_letter = COALESCE($8, dead_letter), | ||
max_retry_delay = $6, |
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.
It was necessary not to use COALESCE because the user may want to set it to null explicitly
ELSE now() + ( | ||
ELSE now() + | ||
LEAST( | ||
( | ||
retry_delay * 2 ^ LEAST(16, retry_count + 1) / 2 + |
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.
This 16
limit is not documented, perhaps it should be removed in favour of max_retry_delay in the future?
CASE | ||
WHEN COALESCE(j.retry_backoff, q.retry_backoff, retry_backoff_default, false) | ||
THEN COALESCE(j.max_retry_delay, q.max_retry_delay, max_retry_delay_default) | ||
ELSE NULL |
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.
When retry_backoff is not true, we force the max delay to NULL
Closes #520
Implements a new flag in
new PgBoss()
,queue
andjob
This flag limits the exponential backoff to the desired delay, in seconds.
I decided to only apply its value if
retryBackoff
is true.Alternatives:
maxRetryBackoffDelay
maxRetryDelay
should also limitretryDelay
, but that seems redundantObservations:
updateQueue
, with an undefined parameter (maybe use explicit null in this case?)