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

Feature request: maxRetryDelay #520

Open
danilofuchs opened this issue Nov 5, 2024 · 2 comments · May be fixed by #531
Open

Feature request: maxRetryDelay #520

danilofuchs opened this issue Nov 5, 2024 · 2 comments · May be fixed by #531

Comments

@danilofuchs
Copy link
Contributor

danilofuchs commented Nov 5, 2024

It would be nice to have an option to limit exponential backoff to some degree or duration.

For instance, we have a process with high likelihood of resolving within 10 seconds but may take up to 30 minutes. If we set retryDelay to 10s and turn on exponentialBackoff, the attempts would roughly happen with these delays:

  • 0 (first attempt)
  • 10 seconds
  • 20 seconds
  • 40 seconds
  • 80 seconds
  • 160 seconds
  • 320 seconds (5 min)
  • 640 seconds (11 min)
  • 1280 seconds (21 min)

At this point, the delay is too large and the user has a degraded experience

If we configured a maxRetryDelay of 80 seconds, the backoff algorithm would be capped to a reasonable duration

@timgit
Copy link
Owner

timgit commented Dec 5, 2024

I agree

@danilofuchs
Copy link
Contributor Author

danilofuchs commented Dec 12, 2024

I would like to contribute this feature!

Does this TODO list seem correct?

  • Add a column max_retry_delay
    • Change plan for queue
    • Change plan for job
    • Change plan for create_queue function
    • Add a migration from version 24 to 25 adding these columns for old deployments
  • Add a maxRetryDelay and maxRetryDelayDefault in the PgBoss interface
  • Change updateQueue, getQueues with max_retry_delay
  • Change insertJob to set max_retry_backoff_delay from either job, queue or default
  • Change insertJobs to set max_retry_backoff_delay from either job, queue or default
  • Change failJobs to limit the delay in the retry job
    • If backoff is configured, limit to the max_retry_delay
    • If backoff is not configured, also limit the max_delay ⚠️ I'm not sure about this, this seems like something that can be confusing. Perhaps we should rename the parameter to max_retry_backoff_delay and limit its scope
  • Change archive to copy the max_retry_delay

@danilofuchs danilofuchs linked a pull request Dec 12, 2024 that will close this issue
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 a pull request may close this issue.

2 participants