You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by "Martin Kleppmann (JIRA)" <ji...@apache.org> on 2014/03/21 18:05:45 UTC

[jira] [Resolved] (SAMZA-178) Review catching of Throwable

     [ https://issues.apache.org/jira/browse/SAMZA-178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Kleppmann resolved SAMZA-178.
------------------------------------

    Resolution: Fixed

I've committed this, resolving.

> Review catching of Throwable
> ----------------------------
>
>                 Key: SAMZA-178
>                 URL: https://issues.apache.org/jira/browse/SAMZA-178
>             Project: Samza
>          Issue Type: Task
>            Reporter: Martin Kleppmann
>            Assignee: Martin Kleppmann
>         Attachments: SAMZA-178.patch, SAMZA-178.v2.patch
>
>
> We have various places in the code where we do:
> {noformat}
> try { ... } catch { case _ => ... }
> try { ... } catch { case e: Throwable => ... }
> {noformat}
> That's potentially dangerous, because Throwable is the supertype for various things that really shouldn't be caught by normal code, such as java.lang.OutOfMemoryError or scala.runtime.NonLocalReturnControl (the latter is used internally by Scala for flow control).
> We should probably change most or all of those occurrences to catch Exception instead. But it's worth reviewing each case to make sure that it really doesn't need to catch Throwable after all.
> See also discussion on https://reviews.apache.org/r/18606/ (SAMZA-161).



--
This message was sent by Atlassian JIRA
(v6.2#6252)