Skip to content

Conversation

@sirewix
Copy link

@sirewix sirewix commented Apr 25, 2024

A solution to #19 based on StructionSite@0489b51

@GoldenChrysus
Copy link

This looks very useful. I have a sentinel job that performs some cleanup once a channel is empty. It does that with checkpoints but a long-running sentinel will end up with an absurdly high backoff as there is no option for linear retries. Looks like this PR would allow me effectively avoid using exponential backoff in the first place.

I wonder if @Diggsey has abandoned this project? PRs have been sitting for a long time despite very active GH activity...

@makorne
Copy link

makorne commented May 23, 2025

No conflicts with base branch, please merge it!!!
I wonder too if @Diggsey has abandoned this project?
PRs have been sitting for a long time despite very active GH activity...

Copy link
Owner

@Diggsey Diggsey left a comment

Choose a reason for hiding this comment

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

Thanks for the PR and sorry for the delay in reviewing!

SET
attempt_at = CASE WHEN mq_msgs.attempts = 1 THEN NULL ELSE NOW() + mq_msgs.retry_backoff END,
attempts = mq_msgs.attempts - 1,
retry_backoff = CASE WHEN max_retry_text IS NULL THEN mq_msgs.retry_backoff * 2 ELSE LEAST(mq_msgs.retry_backoff * 2, max_retry_text) END
Copy link
Owner

Choose a reason for hiding this comment

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

I think this condition is redundant, it can just be:

retry_backoff = LEAST(mq_msgs.retry_backoff * 2, max_retry_text)

I think this should also be called max_retry_interval rather than max_retry_text

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.

4 participants