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

Tathagata Das commented on SPARK-8393:
--------------------------------------

I think the best way is to catch all exceptions in the awaitTermination and 
then disambiguate by type. So the workaround that has been suggested by 
[~vanekjar] is the intended solution. May be it is not clear, and we should add 
more documentation on that. 

Would be good if there is PR updating the Java documentation of the function 
showing this method of catching exceptions. In that case, this JIRA should be 
renamed and converted to an improvement JIRA accordingly. How does that sound?


> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to