On a project I worked on we used a bit of a heavy handed method. Our system
was rather distributed, where servers processed messages off of durable
queues. So we took a simplistic approach: Exceptions that bubbled all the
way up to the top level of the application caused a hard exit of the JVM.
That's right, we crashed the entire JVM (and restarted it) every time we
had a un-handled exception.

Over time we refined this approach to whitelist some exceptions. So a
clojure read exception wouldn't crash the JVM it would only re-try the
message processing. Since our application used durable queues, and because
we had about 20 machines consuming from each queue, a single JVM restarting
here and there wasn't bad. And we gained the assurance that an error
wouldn't leave the JVM in a bad state.

Won't work in all (or most) situations, but it worked pretty well for us.

Timothy

On Mon, Apr 20, 2015 at 2:05 PM, Luc Préfontaine <
lprefonta...@softaddicts.ca> wrote:

> 1) no
> 2) no
> 3) yes at all cost
> 4) both, exceptions are logged with context (current bindings, etc)
> 5) undecided, under close examination however
> 6) never have to restart, we check what cause the error and correct it
> externally if required
>     most errors are reported immediately, may depend on the failed process
> being critical
>     or not.
>
> Up times above 250 days, restarts only required when upgrading stuff.
>
> Luc P.
>
>
> >
> > I'm curious, how are people in the Clojure community currently dealing
> with
> > exceptions? I have a diverse set of questions on this topic.
> >
> > 1.) How many have adopted an Erlang "die fast and restart" strategy?
> >
> > 2.) How many use something like Supervisor to spin up new JVMs? If not
> > Supervisor, then what?
> >
> > 3.) How many try to catch all exceptions and therefore try to keep the
> app
> > running under all circumstances?
> >
> > 4.) If you use something like Kafka to log events, do you use the same
> log
> > to track exceptions, or do you track exceptions separately?
> >
> > 5.) How many use a catch/restart library such as Ribol?
> >
> > 6.) In general, how bad do you expect things to be before you allow the
> > software to die, have Nagios send a pager alert to your sysadmin, drag
> them
> > out of bed at 3 AM, and have a human examine the issue and restart things
> > manually?
> >
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to clojure@googlegroups.com
> > Note that posts from new members are moderated - please be patient with
> your first post.
> > To unsubscribe from this group, send email to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
> > ---
> > You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to clojure+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> --
> Luc Préfontaine<lprefonta...@softaddicts.ca> sent by ibisMail!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to