[jira] [Commented] (SPARK-8393) JavaStreamingContext#awaitTermination() throws non-declared InterruptedException
[ https://issues.apache.org/jira/browse/SPARK-8393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15242956#comment-15242956 ] Apache Spark commented on SPARK-8393: - User 'srowen' has created a pull request for this issue: https://github.com/apache/spark/pull/12418 > 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 >Assignee: Sean Owen >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
[jira] [Commented] (SPARK-8393) JavaStreamingContext#awaitTermination() throws non-declared InterruptedException
[ https://issues.apache.org/jira/browse/SPARK-8393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14599185#comment-14599185 ] Jaromir Vanek commented on SPARK-8393: -- I think the suggested workaround is fine for the current 1.x version of Spark. So updating the documentation would be proper solution to prevent other developers from unexpected problems. But in the next major version of Spark it should be fixed properly and `awaitTermination` method should be declared to throw `InterruptedException`. 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
[jira] [Commented] (SPARK-8393) JavaStreamingContext#awaitTermination() throws non-declared InterruptedException
[ https://issues.apache.org/jira/browse/SPARK-8393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14598769#comment-14598769 ] Apache Spark commented on SPARK-8393: - User 'rekhajoshm' has created a pull request for this issue: https://github.com/apache/spark/pull/6969 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
[jira] [Commented] (SPARK-8393) JavaStreamingContext#awaitTermination() throws non-declared InterruptedException
[ https://issues.apache.org/jira/browse/SPARK-8393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-8393) JavaStreamingContext#awaitTermination() throws non-declared InterruptedException
[ https://issues.apache.org/jira/browse/SPARK-8393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14589483#comment-14589483 ] Jaromir Vanek commented on SPARK-8393: -- {{awaitTerminationOrTimeout}} also throws {{InterruptedException}} in case the thread is interrupted, the only difference is the timeout feature. 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
[jira] [Commented] (SPARK-8393) JavaStreamingContext#awaitTermination() throws non-declared InterruptedException
[ https://issues.apache.org/jira/browse/SPARK-8393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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
[jira] [Commented] (SPARK-8393) JavaStreamingContext#awaitTermination() throws non-declared InterruptedException
[ https://issues.apache.org/jira/browse/SPARK-8393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14588546#comment-14588546 ] Sean Owen commented on SPARK-8393: -- {{awaitTerminationOrTimeout}} will return a {{boolean}} to let you know if it timed out, if that's what you're looking for, but I suspect it's not quite. Yeah, that's a good workaround for now if you really need to handle it. Hm, can you wrap it in a method that {{throws InterruptedException}} and catch for it as normal around an invocation to that method? I think it's still a valid API change for later. 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
[jira] [Commented] (SPARK-8393) JavaStreamingContext#awaitTermination() throws non-declared InterruptedException
[ https://issues.apache.org/jira/browse/SPARK-8393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14587822#comment-14587822 ] Jaromir Vanek commented on SPARK-8393: -- 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. 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 -- 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