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

Sahil Takiar updated HIVE-20273:
--------------------------------
    Description: 
HIVE-19053 and HIVE-19733 added handling of {{InterruptedException}} to 
{{RemoteSparkJobStatus#getSparkJobInfo}} and 
{{RemoteSparkJobStatus#getSparkStagesInfo}}. These methods catch 
{{InterruptedException}} and wrap the exception in a {{HiveException}} and then 
throw the new {{HiveException}}.

This new {{HiveException}} is then caught in 
{{RemoteSparkJobMonitor#startMonitor}} which then looks for exceptions that 
match the condition:

{code}
if (e instanceof InterruptedException ||
                (e instanceof HiveException && e.getCause() instanceof 
InterruptedException))
{code}

If this condition is met (in this case it is), the exception will again be 
wrapped in another {{HiveException}} and is thrown again. So the final 
exception is a {{HiveException}} that wraps a {{HiveException}} that wraps an 
{{InterruptedException}}.

The double nesting of hive exception causes the logic in 
{{SparkTask#setSparkException}} to break, and doesn't cause {{killJob}} to get 
triggered.

  was:HIVE-19053 and HIVE-19733 add handling of {{InterruptedException}} to 
{{#getSparkJobInfo}} and {{#getSparkStagesInfo}} in {{RemoteSparkJobStatus}}, 
but that means the {{InterruptedException}} is wrapped in a {{HiveException}} 
and then thrown. The {{HiveException}} is then cause in 
{{RemoteSparkJobMonitor}} and then wrapped in another Hive exception. The 
double nesting of hive exception causes the logic in 
{{SparkTask#setSparkException}} to break, and it doesn't kill the job if an 
interrupted exception is thrown.


> Spark jobs aren't cancelled if getSparkJobInfo or getSparkStagesInfo
> --------------------------------------------------------------------
>
>                 Key: HIVE-20273
>                 URL: https://issues.apache.org/jira/browse/HIVE-20273
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Spark
>            Reporter: Sahil Takiar
>            Assignee: Sahil Takiar
>            Priority: Major
>         Attachments: HIVE-20273.1.patch
>
>
> HIVE-19053 and HIVE-19733 added handling of {{InterruptedException}} to 
> {{RemoteSparkJobStatus#getSparkJobInfo}} and 
> {{RemoteSparkJobStatus#getSparkStagesInfo}}. These methods catch 
> {{InterruptedException}} and wrap the exception in a {{HiveException}} and 
> then throw the new {{HiveException}}.
> This new {{HiveException}} is then caught in 
> {{RemoteSparkJobMonitor#startMonitor}} which then looks for exceptions that 
> match the condition:
> {code}
> if (e instanceof InterruptedException ||
>                 (e instanceof HiveException && e.getCause() instanceof 
> InterruptedException))
> {code}
> If this condition is met (in this case it is), the exception will again be 
> wrapped in another {{HiveException}} and is thrown again. So the final 
> exception is a {{HiveException}} that wraps a {{HiveException}} that wraps an 
> {{InterruptedException}}.
> The double nesting of hive exception causes the logic in 
> {{SparkTask#setSparkException}} to break, and doesn't cause {{killJob}} to 
> get triggered.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to