-
Notifications
You must be signed in to change notification settings - Fork 317
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
Potential deadlock with Parallel Resource loading #2431
Comments
@iloveeclipse did some more analysis we will try to offload the work of @szarnekow do you have some usecases in mind where late invalidation or updating of the data cache might be a problem |
maybe we also need to do some similar magic like
for all modify operations and make the read ops not needing a synchonized |
if the NotifyJob happens async "somewhen" then i wonder if e.g. org.eclipse.xtext.builder.impl.javasupport.JdtToBeBuiltComputer.updateProject(ToBeBuilt, IProject, IProgressMonitor) |
Processing change events on workspace notification thread is a problem, because it holds that workspace lock and As discussed, Therefore my original root cause assessment was wrong, I will update the description about threads involved in the deadlock. So the probably easiest solution for Xtext is to decouple We've tried to replace Storage2UriMapperJavaImpl with our own implementation that simply runs a separated job on Storage2UriMapperJavaImpl.elementChanged, but that runs in a sporadic test issues because it tried then to update cache for already deleted projects. So ideally update cache would either not require hard "synchronized" lock (use ILock for example, that could be interrupted) or not lock at all (may be call the problematic code that tries to resolve classpath at different time?). Below is also the main problem source:
|
SIde note: JDT changed the behaviour of getHandleIdentifier last year to do a resolveClasspath which might have terribly accelerated the problem (asked at jdt-dev, lets see that they say) |
we have a potential deadlock with Parallel Resource loading
waits for workspace lock and blocks other accesses to PackageFragmentRootData
waits
this one may invalidate the classpath
this one owns the workspace lock, but is blocked by the load operation waiting for the workspace lock
The text was updated successfully, but these errors were encountered: