Uh oh!
There was an error while loading. Please reload this page.
[SPARK-20459][SQL] JdbcUtils throws IllegalStateException: Cause already initialized after getting SQLException - #17800
[SPARK-20459][SQL] JdbcUtils throws IllegalStateException: Cause already initialized after getting SQLException#17800srowen wants to merge 2 commits into
Conversation
SparkQA
commented
Apr 28, 2017
Test build #76265 has finished for PR 17800 at commit
|
| try { | ||
| e.initCause(cause) | ||
| } catch { | ||
| // cause may have been explicitly initialized to null, in which case this |
There was a problem hiding this comment.
Based on my understanding, IllegalStateException is not caused by the value of cause.
@throwsIllegalStateExceptionifthisthrowablewascreatedwith {@link #Throwable(Throwable)} or
{@link #Throwable(String,Throwable)}, orthismethodhasalreadybeencalledonthisthrowable.There was a problem hiding this comment.
No the issue is simply whether the cause has been initialized at all. If it has been initialized to null, then e.getCause returns null, but the current code takes that to mean the cause is uninitialized (because it would return null) in that case. If it were initialized to an actual exception it already would call addSuppressed instead.
There was a problem hiding this comment.
@gatorsmile oh are you suggesting the comment is a bit misleading? yeah I can fix that to be clearer about the scenario
There was a problem hiding this comment.
Yeah. Please update the comment. Thanks!
gatorsmile
commented
May 1, 2017
LGTM |
SparkQA
commented
May 1, 2017
Test build #76354 has finished for PR 17800 at commit
|
gatorsmile
commented
May 2, 2017
Thanks! Merging to master/2.2 |
…ady initialized after getting SQLException ## What changes were proposed in this pull request? Avoid failing to initCause on JDBC exception with cause initialized to null ## How was this patch tested? Existing tests Author: Sean Owen <sowen@cloudera.com> Closes#17800 from srowen/SPARK-20459. (cherry picked from commit af726cd) Signed-off-by: Xiao Li <gatorsmile@gmail.com>
srowen
commented
May 2, 2017
@gatorsmile do you think this should go back into 2.1? seems like a clean fix to a non-trivial problem. I don't particularly care either way; you may have more context about the problem. |
What changes were proposed in this pull request?
Avoid failing to initCause on JDBC exception with cause initialized to null
How was this patch tested?
Existing tests