This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | [68cat] AWT thread blocked for 3569 ms. | ||
---|---|---|---|
Product: | java | Reporter: | dheffelfinger <dheffelfinger> |
Component: | Project | Assignee: | Tomas Zezula <tzezula> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | dkonecny, tzezula |
Priority: | P3 | Keywords: | PERFORMANCE |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://statistics.netbeans.org/exceptions/detail.do?id=157898 | ||
Issue Type: | DEFECT | Exception Reporter: | 157898 |
Attachments: |
nps snapshot
patch idea |
Description
dheffelfinger
2009-10-03 15:37:07 UTC
Created attachment 88786 [details]
nps snapshot
This issue already has 7 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=157898 Tomas, Web and J2SE project are using the same mechanism for synchronize their implementation of Sources.getSourceGroups - project read access is requested within which dirty flag is tested. This solution has problem illustrated by this performance report: if there is somebody who holds write lock for a long time then WebSource.getSourceGroups or J2SESources.getSourceGroups are blocked. In this perf thread dump saving of projects is done in background thread which consequently blocks AWT thread. What do you think we could/should do? I'm attaching a patch which checks dirty flag before entering project mutex which could help in *some* cases. Created attachment 88807 [details]
patch idea
The patch may cause a deadlock. The problem is that the defined lock ordering is ProjectMutex, private lock. In the current impl the J2SESources even eliminates the private lock when calling getSourceGroups. In the patch the getSourceGroups is called only under the private lock which may cause reverse ordering as the getSourceGroups may acquire the ProjectMutex. re. "In the patch the getSourceGroups is called only under the private lock which may cause reverse ordering as the getSourceGroups may acquire the ProjectMutex" - yes, but "delegate" is of type of org.netbeans.spi.project.support.ant.SourcesHelper.SourcesImpl which does not acquire ProjectMutex. Any suggestion for better fix? Passing to Java project to resolve this issue in J2SEProject and then fix should be copied to Web project. jet-main cde4c8416b1c Ported to web/j2ee projects as e5acb588e4c9 Tomas, your caching is broken as it is not taking into account type. I fixed it for web/j2ee projects in web-main in 1b433a12c65d by turning cachedGroups into Map<String, SourceGroup[]>. Please review. I would fix it in J2SE as well but I do not have your change yet. Thanks David, I will port the fix into j2seproject. Sorry I've forgot about the types of source groups. Fixed in jet-main: f2e2019cac48 |