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 247317 - UI freeze if reading a file takes long time
Summary: UI freeze if reading a file takes long time
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-19 21:40 UTC by Vladimir Kvashin
Modified: 2014-09-24 14:18 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
full thread dump (32.27 KB, text/plain)
2014-09-19 21:40 UTC, Vladimir Kvashin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2014-09-19 21:40:55 UTC
Created attachment 149383 [details]
full thread dump

If refreshing of a file is slow (which can always be the case on remote systems), then NetBeans UI freezes for a long time. Even though refresh is done in a separate thread, it locks document; at the same time UndoRedoManager tries to get lock on this document in EDT. So EDT is blocked until file refresh is done. Here are 2 threads of interest, the full thread dump is in the attachment.

"AWT-EventQueue-0" prio=10 tid=0x00007fd2c00c7800 nid=0x20a1 in Object.wait() [0x00007fd30592b000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00000000eb9ee800> (a org.netbeans.modules.editor.NbEditorDocument)
	at java.lang.Object.wait(Object.java:503)
	at javax.swing.text.AbstractDocument.readLock(AbstractDocument.java:1387)
	- locked <0x00000000eb9ee800> (a org.netbeans.modules.editor.NbEditorDocument)
	at org.netbeans.editor.BaseDocument.render(BaseDocument.java:1389)
	at org.openide.text.UndoRedoManager$DocLockedRun.<init>(UndoRedoManager.java:634)
	at org.openide.text.UndoRedoManager.canUndo(UndoRedoManager.java:448)
	at org.netbeans.core.multiview.MultiViewPeer$DelegateUndoRedo.canUndo(MultiViewPeer.java:1098)
	at org.openide.actions.UndoRedoAction.run(UndoRedoAction.java:157)
	at org.openide.actions.UndoRedoAction.propertyChange(UndoRedoAction.java:252)
	at org.openide.util.WeakListenerImpl$PropertyChange.propertyChange(WeakListenerImpl.java:197)
	at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
	at org.netbeans.core.windows.RegistryImpl.doFirePropertyChange(RegistryImpl.java:329)
	at org.netbeans.core.windows.RegistryImpl.access$100(RegistryImpl.java:69)
	at org.netbeans.core.windows.RegistryImpl$1.run(RegistryImpl.java:170)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
        ....

"org.openide.text Document Processing" daemon prio=10 tid=0x00007fd2dc021000 nid=0x25c4 runnable [0x00007fd288851000]
   java.lang.Thread.State: RUNNABLE
	at org.netbeans.modules.remote.impl.fs.RemoteDirectory.refreshImpl(RemoteDirectory.java:1591)
	at org.netbeans.modules.remote.impl.fs.RemotePlainFile.refreshImpl(RemotePlainFile.java:442)
	at org.netbeans.modules.remote.impl.fs.RemoteFileObjectBase.refresh(RemoteFileObjectBase.java:543)
	at org.netbeans.modules.remote.impl.fs.RemoteFileObject.refresh(RemoteFileObject.java:262)
	at org.openide.text.DataEditorSupport$Env$1.run(DataEditorSupport.java:916)
	at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:127)
	at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:641)
	at org.openide.text.DataEditorSupport$Env.getTime(DataEditorSupport.java:920)
	at org.openide.text.CloneableEditorSupport.updateLastSaveTime(CloneableEditorSupport.java:2083)
	at org.openide.text.DocumentOpenClose$DocumentLoad.atomicLockedRun(DocumentOpenClose.java:779)
	at org.openide.text.DocumentOpenClose$DocumentLoad.run(DocumentOpenClose.java:613)
	at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:323)
	at org.openide.text.NbDocument.runAtomic(NbDocument.java:436)
	at org.openide.text.DocumentOpenClose$DocumentLoad.run(DocumentOpenClose.java:653)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)