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

Certain unique jobs states configuration can block all jobs from retrying #1259

Open
freemer opened this issue Feb 28, 2025 · 1 comment
Open
Labels
area:oss Related to Oban OSS kind:enhancement New feature or request

Comments

@freemer
Copy link

freemer commented Feb 28, 2025

Environment

  • Oban Version: 2.19.2
  • PostgreSQL Version: 16.6
  • Elixir & Erlang/OTP Versions: Elixir 1.17.2 (compiled with Erlang/OTP 27)

Current Behavior

Having jobs with a state of retryable that were enqueued with unique: [:available, :scheduled, :executing] can cause all jobs with a state of retryable to not retry.

Expected Behavior

Retryable jobs will always retry irrespective of unique configuration

@sorentwo sorentwo added kind:enhancement New feature or request area:oss Related to Oban OSS labels Mar 3, 2025
@sorentwo
Copy link
Member

sorentwo commented Mar 3, 2025

As reported, this issue only impacts Pro v1.5 and will be "bandaged" in v1.5.3. The solution we'd like to drive toward is providing a set of ordained unique states that are safe to use and not inherently flawed. That can either be through functions on Oban.Job, or through named expansions.

The named expansions would be used like unique: [states: :incomplete], where the expansions are:

  • :all - ~w(available scheduled executing retryable complete cancelled discarded)a
  • :incomplete - ~w(available scheduled executing retryable)a
  • :scheduled - ~w(scheduled)
  • :successful - ~w(available scheduled executing retryable complete)a (the default)

Setting a list of states would be deprecated, but continue to work for backward compatibility. The obvious outlier above is for scheduled, which is safe by itself and useful for debounced insertions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:oss Related to Oban OSS kind:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants