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.

Bug 186808

Summary: ClassBasedBreakpoint.remove() waiting on a lock in AWT
Product: debugger Reporter: Martin Entlicher <mentlicher>
Component: JavaAssignee: Martin Entlicher <mentlicher>
Status: RESOLVED FIXED    
Severity: normal CC: gorrus, tpavek
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Martin Entlicher 2010-05-27 13:17:04 UTC
ClassBasedBreakpoint.remove() is waiting on a lock that can be held by ClassBasedBreakpoint.isEnabled() for a long time. When ClassBasedBreakpoint.remove() is called in AWT thread, AWT is blocked until ClassBasedBreakpoint.isEnabled() finishes. This makes IDE unresponsive.
Comment 1 Tomas Pavek 2010-05-27 14:33:44 UTC
Perhaps should consider to remove the logic in ClassBasedBreakpoint.isEnabled() completely. It looks for explicitly disabled source roots not to submit breakpoints from them. There's very low chance this would be useful for anybody (why to have breakpoints in disabled sources anyway?), yet it potentially slows down everyone.
Comment 2 Martin Entlicher 2010-05-28 09:10:43 UTC
For reference, see issue #186345 - attachment deb2.nps (http://netbeans.org/bugzilla/attachment.cgi?id=99530) - where ClassBasedBreakpoint.isEnabled() takes 50 seconds, because it is waiting for filesystem.

In the profiler snapshot method
"protected boolean isEnabled(String sourcePath, String[] preferredSourceRoot)"
is called. This checks whether the breakpoint belongs to the first matched source root on the source path. This is necessary when there are two projects with identical sources. We must take breakpoints only from the project that is actually used for debugging.

I have to leave that code there, but I think that it does not have to be synchronized. It must not block AWT.
Comment 3 Martin Entlicher 2010-06-01 13:03:06 UTC
Fixed in changeset 172280	0358eba9bfc9
http://hg.netbeans.org/main/rev/0358eba9bfc9
Comment 4 Quality Engineering 2010-06-03 06:15:01 UTC
Integrated into 'main-golden', will be available in build *201006030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/0358eba9bfc9
User: mentlicher@netbeans.org
Log: #186808 Synchronization is reduced so that we do not do expansive work under SOURCE_ROOT_LOCK, which can be acquired in AWT thread.