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 146155

Summary: AWT blocked for minutes after startup
Product: editor Reporter: Jaroslav Tulach <jtulach>
Component: SettingsAssignee: Vitezslav Stejskal <vstejskal>
Status: RESOLVED FIXED    
Severity: blocker CC: issues
Priority: P2 Keywords: PERFORMANCE, THREAD
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 142767    
Bug Blocks:    
Attachments: full thread dump

Description Jaroslav Tulach 2008-09-04 10:52:26 UTC
Build from 4Sep, 2008, blocks AWT after startup waiting in CodeStylePreferences. 

"AWT-EventQueue-1" prio=10 tid=0x082dc000 nid=0x27c6 waiting for monitor entry [0x8cafe000..0x8caff0b0]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at org.netbeans.modules.editor.indent.spi.CodeStylePreferences.get(CodeStylePreferences.java:180)
        - waiting to lock <0x9453b910> (a java.util.WeakHashMap)
        at org.netbeans.modules.editor.indent.spi.CodeStylePreferences.get(CodeStylePreferences.java:103)
        at org.netbeans.modules.editor.indent.api.IndentUtils.tabSize(IndentUtils.java:122)
        at org.netbeans.modules.editor.NbEditorDocument.getTabSize(NbEditorDocument.java:144)
        at org.netbeans.editor.BaseDocument.getVisColFromPos(BaseDocument.java:2108)
        - locked <0x93fd7ce8> (a java.lang.Object)
        at org.netbeans.editor.Utilities.getVisualColumn(Utilities.java:647)
        at org.netbeans.editor.Utilities.debugPosition(Utilities.java:1100)
        at org.netbeans.editor.StatusBar$CaretListener.actionPerformed(StatusBar.java:570)
        at org.netbeans.editor.WeakTimerListener.actionPerformed(WeakTimerListener.java:85)
        at javax.swing.Timer.fireActionPerformed(Timer.java:271)
        at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
Comment 1 Jaroslav Tulach 2008-09-04 10:52:58 UTC
Created attachment 69036 [details]
full thread dump
Comment 2 Jan Becicka 2008-09-05 10:02:29 UTC
Vito, please take a look at it. Thanks.
Comment 3 Vitezslav Stejskal 2008-09-05 11:10:48 UTC
It's still the same story, which I'm pretty sure Jarda already knows. In short: pre-project formatting settings -> need
ProjectManager.mutex() -> when opening projects somebody else holds the mutex -> we can't open a document, render it or
do pretty much anything else and end up blocking AWT.

The real question is 'do we need to writeLock the mutex'? Maybe not, see issue #142767. Is anybody bold enough to make
the change suggested in #142767. I guess not, so it's probably gonna have to be me. (puke)
Comment 4 Vitezslav Stejskal 2008-09-05 11:50:17 UTC
With #142767 fixed I also changed CodeStylePreferences to use readAccess, which should improve the situation.
http://hg.netbeans.org/main/rev/917a3b0e6eb2
Comment 5 Quality Engineering 2008-09-05 17:31:17 UTC
Integrated into 'main-golden', will be available in build *200809051401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/917a3b0e6eb2
User: Vita Stejskal <vstejskal@netbeans.org>
Log: #146155: AuxiliaryConfigBasedPreferences.node now uses readAccess (see #142767) and we can now use readAccess too