Skip to content

Commit

Permalink
[mod] [#301] Message queue shouldn't catch OOM, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed May 27, 2024
1 parent 6bb4d0c commit d3df994
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/taoensso/carmine/message_queue.clj
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,9 @@
:a [qk-a qk-b]
:b [qk-b qk-a]))]

(try ; NB conn's read-timeout may be insufficient!
(enc/try* ; NB conn's read-timeout may be insufficient!
(wcar conn-opts (car/brpoplpush qk-src qk-dst secs-dbl))
(catch Throwable _ nil))))
(catch :all-but-critical _ nil))))

(comment (interruptible-sleep {} :foo :a 2000))

Expand Down Expand Up @@ -527,7 +527,7 @@

t0 (enc/now-nano*)
result
(try
(enc/try*
(let [mq-msg
{:qname qname :mid mid
:message mcontent :attempt attempt
Expand All @@ -538,7 +538,7 @@

(handler mq-msg))

(catch Throwable t
(catch :all-but-critical t
{:status :error :throwable t}))

handling-time-ns (- (enc/now-nano*) t0)
Expand Down Expand Up @@ -720,7 +720,7 @@
:backoff-ms backoff-ms})
(Thread/sleep (int backoff-ms))))))

(try
(enc/try*
(let [resp
(wcar conn-opts
(dequeue qname worker-opts)
Expand All @@ -731,7 +731,7 @@
(throw t)
(future-pool
(fn []
(try
(enc/try*
(let [[poll-reply ndry-runs & queue-counts] resp
{:keys [nqueued]} (-queue-status queue-counts)]

Expand All @@ -754,8 +754,8 @@
:ssb-handling-time-ns ssb-handling-time-ns})

(nconsecutive-errors* :set 0))
(catch Throwable t (loop-error! t)))))))
(catch Throwable t (loop-error! t)))
(catch :all-but-critical t (loop-error! t)))))))
(catch :all-but-critical t (loop-error! t)))

(when-let [ms (throttle-ms-fn)] (Thread/sleep (int ms)))
(recur (inc nloops))))))]
Expand Down

0 comments on commit d3df994

Please sign in to comment.