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 42479 - [perf] Rename action is blocking AWT thread
Summary: [perf] Rename action is blocking AWT thread
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Jan Becicka
URL:
Keywords: PERFORMANCE
Depends on: 43952
Blocks:
  Show dependency tree
 
Reported: 2004-04-26 17:33 UTC by Antonin Nebuzelsky
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread Dump at the moment I clicked "Do Refactoring" for rename. (9.87 KB, text/plain)
2004-04-29 13:15 UTC, Antonin Nebuzelsky
Details
Thread dump shows that AWT thread is blocked waiting for a mutex in javacore (via NBMDRepositoryImpl.beginTrans) (16.30 KB, text/plain)
2004-05-19 15:59 UTC, Antonin Nebuzelsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonin Nebuzelsky 2004-04-26 17:33:45 UTC
Part of rename functionality is performed in AWT
thread, blocking the whole IDE's UI for a long time.

Thread dump shows
o.n.m.java.JavaParserGlue$2.run() is the culprit.
Comment 1 Jan Becicka 2004-04-29 11:27:14 UTC
Please attach thread dump. JavaParserGlue doesn't have direct relation
to any refactoring - well - should not have :)
Comment 2 Antonin Nebuzelsky 2004-04-29 13:15:15 UTC
Created attachment 14614 [details]
Thread Dump at the moment I clicked "Do Refactoring" for rename.
Comment 3 Jan Becicka 2004-05-03 14:12:22 UTC
Fixed.
RefireCookieChange was performed in AWT Event Queue. I moved it to
RequestProcessor.
Checking in JavaParserGlue.java;
/cvs/java/src/org/netbeans/modules/java/JavaParserGlue.java,v  <-- 
JavaParserGlue.java
new revision: 1.44.20.4; previous revision: 1.44.20.3
Comment 4 Antonin Nebuzelsky 2004-05-14 17:58:15 UTC
The behaviour of the action is not a bit better.
Have you tried it after you made the "fix"?
Comment 5 Jan Becicka 2004-05-17 09:59:15 UTC
Did you make a thread dump before you reopened your "issue". You
reported, that o.n.m.java.JavaParserGlue is blocking AWT Thread.
I fixed this issue.
Can you attach thread dump showing, that JavaParserGlue is doing that?

Problem is, that all files, modified by refactoring, are reparsed at
the end of MDR transaction. This is done in separate thread, but
JavaEditor is waiting for ExlusiveMutex (held by MDR Thread) in AWT
event queue.
Comment 6 Antonin Nebuzelsky 2004-05-17 10:37:06 UTC
This bug is about "Rename action is blocking AWT thread". If you fixed
a part of the problem, you should reassign the bug to editor to fix
the rest.
Comment 7 Antonin Nebuzelsky 2004-05-19 15:59:40 UTC
Created attachment 15010 [details]
Thread dump shows that AWT thread is blocked waiting for a mutex in javacore (via NBMDRepositoryImpl.beginTrans)
Comment 8 Jan Becicka 2004-05-20 06:49:42 UTC
Unfortunately I don't have any idea how to fix it.
Refactoring is done in Request Processor Thread and holds
ExclusiveMutex during it's transaction.
Anyone can request ExclusiveMutex while it is held by other
transaction and must wait for it.
Any help would be appreciated.
Comment 9 Antonin Nebuzelsky 2004-05-20 13:18:05 UTC
Would it be possible to use ReadMutex/WriteMutex technique instead of
ExclusiveMutex, allowing owners of ReadMutex to get the old state
information until the write transaction is completed (and thus not
blocking the readers)?

I am not sure if transactional mechanism in MDR would allow such a
different approach, but it seems to be the only way to minimize the
duration of the state when MDR is totally locked (for readers of the
information).

Other way would be perhaps minimizing the need of getting information
from MDR from other modules than refactoring, which is perhaps unfeasible.
Comment 10 Tomas Hurka 2004-06-22 08:41:53 UTC
Moved to new subcomponent java/javacore.
Comment 11 Jan Becicka 2004-06-29 09:27:52 UTC
Cannot reproduce any more. AWT was blocked by JavaNodes. This issue
was already fixed.
Comment 12 Antonin Nebuzelsky 2004-07-01 16:41:42 UTC
Verified in trunk build 200406301800.
Comment 13 Quality Engineering 2007-09-20 11:00:46 UTC
Reorganization of java component