[ 
https://issues.apache.org/jira/browse/SPARK-8393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14588013#comment-14588013
 ] 

Jaromir Vanek commented on SPARK-8393:
--------------------------------------

It's not a big problem in Java. But I took me quite a bit of time to realize 
where exactly this {{InterruptedException}} comes from.
 
In Java it can be caught as general {{Exception}}:

{code}
try {
  streamingContext.awaitTermination();
} catch (Exception e) {
  if (e instanceof InterruptedException) {
    // handle exception
  }
{code}

As far as I know {{awaitTerminationOrTimeout}} may throw the same exception as 
well.

> JavaStreamingContext#awaitTermination() throws non-declared 
> InterruptedException
> --------------------------------------------------------------------------------
>
>                 Key: SPARK-8393
>                 URL: https://issues.apache.org/jira/browse/SPARK-8393
>             Project: Spark
>          Issue Type: Bug
>          Components: Streaming
>    Affects Versions: 1.3.1
>            Reporter: Jaromir Vanek
>            Priority: Trivial
>
> Call to JavaStreamingContext#awaitTermination() can throw 
> InterruptedException which cannot be caught easily in Java because it's not 
> declared in @throws(classOf[InterruptedException]) annotation.
> This InterruptedException comes originally from ContextWaiter where Java 
> ReentrantLock is used.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to