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

Parallel request to replay dead job enqueues same job twice in the ready queue (in redis) #179

Open
alishamohanty opened this issue Jul 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@alishamohanty
Copy link
Contributor

Describe the bug

Parallel request to replay dead job enqueues same job twice in the ready queue.

To Reproduce

(deftest parallel-replay-same-job
  (testing "Check the output for parallel prioritisation and deletion"
    (f/create-jobs {:dead 1})
    (let [[job] (dead-jobs/get-by-range tu/redis-conn 0 0)
          response (pcalls (fn [] (dead-jobs/replay-job tu/redis-conn job)) (fn [] (dead-jobs/replay-job tu/redis-conn job)))

          _ (println response)
          _ (println (enqueued-jobs/get-by-range tu/redis-conn tu/queue 0 10));; 2 jobs
          _ (println (enqueued-jobs/size tu/redis-conn tu/queue)) ;; 2
          _ (println (dead-jobs/get-by-range tu/redis-conn 0 10))]))) ;; 0

Versions

  1. Goose: 0.5.1
  2. Clojure: 1.11.0

Screenshots

If applicable, add screenshots to help explain your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant