-
Notifications
You must be signed in to change notification settings - Fork 597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BaseRecalibratorSpark fails on a cluster due to system classloader issue #5979
Conversation
… find a resource.
@LeeTL1220 would you mind taking a look at this please (it came about from changes in #5941). |
Stack trace from failed job:
|
Codecov Report
@@ Coverage Diff @@
## master #5979 +/- ##
===========================================
Coverage 86.929% 86.929%
Complexity 32721 32721
===========================================
Files 2013 2013
Lines 151306 151306
Branches 16610 16610
===========================================
Hits 131529 131529
Misses 13720 13720
Partials 6057 6057
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple comments, please address.
No need to have me re-review unless you want it. So I have approved the review ...
if (systemResourceAsStream == null) { | ||
throw new GATKException("Null value when trying to read system resource. Cannot find: " + resourcePath); | ||
if (resourceAsStream == null) { | ||
resourceAsStream = Resource.class.getClassLoader().getResourceAsStream(resourcePath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just use this statement above and eliminate the if
statement?
I.e. replace InputStream resourceAsStream = ClassLoader.getSystemResourceAsStream(resourcePath);
with
InputStream resourceAsStream = Resource.class.getClassLoader().getResourceAsStream(resourcePath);
I would think that the ClassLoader
would be equivalent to Resource.class.getClassLoader()
Apologies if I am forgetting something....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right. A test seems to be failing now, but I'm not sure it's related. I'll investigate.
|
||
if (systemResourceAsStream == null) { | ||
throw new GATKException("Null value when trying to read system resource. Cannot find: " + resourcePath); | ||
if (resourceAsStream == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a one-line comment why we need this? "For Spark, etc etc"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Thank you for taking a look @LeeTL1220. |
The problem is that Spark executors can't rely on the system classloader to load resources. This change falls back to the current classloader if the resource can't be loaded from the system classloader. I've tested it successfully on a cluster.