-
Notifications
You must be signed in to change notification settings - Fork 82
classloader concurrency #2559
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
classloader concurrency #2559
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2559 +/- ##
=======================================
Coverage 46% 46%
- Complexity 6627 6631 +4
=======================================
Files 792 792
Lines 65361 65374 +13
Branches 9786 9788 +2
=======================================
+ Hits 30476 30486 +10
- Misses 32533 32536 +3
Partials 2352 2352 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
DavyLandman
left a comment
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 get the fix for the ThreadLocal, but I'm unsure about the computeIfAbsent fix. I guess the new code would work, but I'm a bit hesitant if it's needed.
src/org/rascalmpl/uri/classloaders/SourceLocationClassLoader.java
Outdated
Show resolved
Hide resolved
I had the same doubts. The reason is that computeIfAbsent can enter itself recursively due to cyclic class dependencies. It throws an exception when that happens. This new code recurses between the get and the set such that this can't happen. It looks ugly compared to the computeIfAbsent design. |
e4d738d to
1b75137
Compare
|
I've updated the code and added some comments to explain this. if the test succeed, this will be merged. |
ClassLoader.resolveto increase class lookup efficiency without changing semanticsThis is meant to fix the persistent exceptions thrown by the tutor when compiling
rascal-shell blocks that define syntax definitions. What happens is that classes
are being loaded by four concurrent Evaluator instances:
All of these share the same parent classloader, and some of these share a SourceLocationClassLoader maybe.
Example stacktrace fixed by this PR: