Skip to content

Loading…

Catch exceptions when processing expired events #100

Merged
merged 1 commit into from

2 participants

@lwf

On occasion I've had uncaught exceptions happen while expired events are streamed from the reaper thread, causing it to die silently. Not sure where the exceptions originate, but this works around the problem and is probably reasonable anyway.

@aphyr

Thanks a bundle lwf!

@aphyr aphyr merged commit b5f2ff3 into riemann:master

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 27, 2012
  1. Catch exceptions when processing expired events

    Torbjörn Norinder committed
Showing with 11 additions and 8 deletions.
  1. +11 −8 src/riemann/core.clj
View
19 src/riemann/core.clj
@@ -26,14 +26,17 @@
streams (:streams core)]
(when i
(doseq [state (index/expire i)]
- (let [e {:host (:host state)
- :service (:service state)
- :state "expired"
- :time (unix-time)}]
- (when-let [registry (:pubsub core)]
- (ps/publish registry "index" e))
- (doseq [stream streams]
- (stream e))))))))))
+ (try
+ (let [e {:host (:host state)
+ :service (:service state)
+ :state "expired"
+ :time (unix-time)}]
+ (when-let [registry (:pubsub core)]
+ (ps/publish registry "index" e))
+ (doseq [stream streams]
+ (stream e)))
+ (catch Exception e
+ (warn e "Caught exception while processing expired events"))))))))))
(defn core
"Create a new core."
Something went wrong with that request. Please try again.