[jira] [Commented] (SPARK-21081) Throw specific IllegalStateException subtype when asserting that SparkContext not stopped
[ https://issues.apache.org/jira/browse/SPARK-21081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16050927#comment-16050927 ] Sean Owen commented on SPARK-21081: --- [~fzhinkin] when isn't it possible? you can {{ catch { case e: IllegalStateException if sc.isStopped => ... } }} I'm not sure there's an argument for this change, which would be sort of inconsistent with how the rest of the code deals with exceptions. > Throw specific IllegalStateException subtype when asserting that SparkContext > not stopped > - > > Key: SPARK-21081 > URL: https://issues.apache.org/jira/browse/SPARK-21081 > Project: Spark > Issue Type: Improvement > Components: Spark Core >Affects Versions: 2.1.1 >Reporter: Filipp Zhinkin >Priority: Minor > > org.apache.spark.SparkContext.assertNotStopped throws IllegalStateException > if the context was stopped. > Unfortunately, it is not so easy to distinguish IAE caused by a stopped > context from some other failed assertion and handle it properly (start a new > context, for example). > I'm suggesting to add a specific IllegalStateException subclass > (SparkContextClosedException) and start throwing it. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-21081) Throw specific IllegalStateException subtype when asserting that SparkContext not stopped
[ https://issues.apache.org/jira/browse/SPARK-21081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16050256#comment-16050256 ] Filipp Zhinkin commented on SPARK-21081: It's not always an option to call isStopped. > Throw specific IllegalStateException subtype when asserting that SparkContext > not stopped > - > > Key: SPARK-21081 > URL: https://issues.apache.org/jira/browse/SPARK-21081 > Project: Spark > Issue Type: Improvement > Components: Spark Core >Affects Versions: 2.1.1 >Reporter: Filipp Zhinkin >Priority: Minor > > org.apache.spark.SparkContext.assertNotStopped throws IllegalStateException > if the context was stopped. > Unfortunately, it is not so easy to distinguish IAE caused by a stopped > context from some other failed assertion and handle it properly (start a new > context, for example). > I'm suggesting to add a specific IllegalStateException subclass > (SparkContextClosedException) and start throwing it. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-21081) Throw specific IllegalStateException subtype when asserting that SparkContext not stopped
[ https://issues.apache.org/jira/browse/SPARK-21081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16048855#comment-16048855 ] Sean Owen commented on SPARK-21081: --- Just call is stopped to check that. This isn't something that should be handled by catching exceptions > Throw specific IllegalStateException subtype when asserting that SparkContext > not stopped > - > > Key: SPARK-21081 > URL: https://issues.apache.org/jira/browse/SPARK-21081 > Project: Spark > Issue Type: Improvement > Components: Spark Core >Affects Versions: 2.1.1 >Reporter: Filipp Zhinkin >Priority: Minor > > org.apache.spark.SparkContext.assertNotStopped throws IllegalStateException > if the context was stopped. > Unfortunately, it is not so easy to distinguish IAE caused by a stopped > context from some other failed assertion and handle it properly (start a new > context, for example). > I'm suggesting to add a specific IllegalStateException subclass > (SparkContextClosedException) and start throwing it. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-21081) Throw specific IllegalStateException subtype when asserting that SparkContext not stopped
[ https://issues.apache.org/jira/browse/SPARK-21081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16048830#comment-16048830 ] Filipp Zhinkin commented on SPARK-21081: I have an application that fires alerts when some unexpected issues happened, but stopped spark context is not a such issue. So I want to handle corresponding exception separately. Without a special exception I have to catch IllegalStateException and then check that its message contains "Cannot call methods on a stopped SparkContext.". > Throw specific IllegalStateException subtype when asserting that SparkContext > not stopped > - > > Key: SPARK-21081 > URL: https://issues.apache.org/jira/browse/SPARK-21081 > Project: Spark > Issue Type: Improvement > Components: Spark Core >Affects Versions: 2.1.1 >Reporter: Filipp Zhinkin >Priority: Minor > > org.apache.spark.SparkContext.assertNotStopped throws IllegalStateException > if the context was stopped. > Unfortunately, it is not so easy to distinguish IAE caused by a stopped > context from some other failed assertion and handle it properly (start a new > context, for example). > I'm suggesting to add a specific IllegalStateException subclass > (SparkContextClosedException) and start throwing it. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-21081) Throw specific IllegalStateException subtype when asserting that SparkContext not stopped
[ https://issues.apache.org/jira/browse/SPARK-21081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16048104#comment-16048104 ] Sean Owen commented on SPARK-21081: --- Where would you want to catch and handle that separately? > Throw specific IllegalStateException subtype when asserting that SparkContext > not stopped > - > > Key: SPARK-21081 > URL: https://issues.apache.org/jira/browse/SPARK-21081 > Project: Spark > Issue Type: Improvement > Components: Spark Core >Affects Versions: 2.1.1 >Reporter: Filipp Zhinkin >Priority: Minor > > org.apache.spark.SparkContext.assertNotStopped throws IllegalStateException > if the context was stopped. > Unfortunately, it is not so easy to distinguish IAE caused by a stopped > context from some other failed assertion and handle it properly (start a new > context, for example). > I'm suggesting to add a specific IllegalStateException subclass > (SparkContextClosedException) and start throwing it. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org