Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359433 - Right click on a project cause Eclipse freeze for minuts
Summary: Right click on a project cause Eclipse freeze for minuts
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 critical (vote)
Target Milestone: 1.2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-29 10:24 EDT by Nuk CLA
Modified: 2016-10-21 07:08 EDT (History)
5 users (show)

See Also:


Attachments
Stack trace from Suspend (8.67 KB, text/plain)
2011-12-19 13:12 EST, Carolyn MacLeod CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nuk CLA 2011-09-29 10:24:06 EDT
Build Identifier: M20110909-1335

After successfully cloned a git repository and imported a project into the project explorer, a right click on the project in the project explorer causes Eclipse Freeze (not responding) for severals minuts before the dialog open.

I have the problem over 4 PC's that have cloned the same repository.

Actually, everything works fine with any small repository but this one have more than 7K files into 1K directory for a total of 178Mo of sources. I guess this is the problem.

Turning off git label decoration doesn't solve the problem.

You also have to know that running exactly the same Eclipse with the tha git repository on a Windows XP PC just working fine and fast, not on Seven or Vista.

Reproducible: Always

Steps to Reproduce:
1.Right click on a very big project
2. Wait and cry.
Comment 1 Remy Suen CLA 2011-09-29 22:48:54 EDT
When the hang occurs, please get a thread dump.
Comment 2 Matthias Sohn CLA 2011-10-09 09:05:09 EDT
Which EGit version are you using ?
Could you retry with a recent nightly build version of EGit, find it here [1]

[1] http://download.eclipse.org/egit/updates-nightly
Comment 3 Remy Suen CLA 2011-10-22 22:21:20 EDT
Matthias, I think some of the time may be taken up by the isEnabled() method of CompareIndexWithHeadActionHandler. Part of that code path executes an index diff so this will be a time consuming operation for a large repository.
Comment 4 Nuk CLA 2011-10-24 05:07:42 EDT
I've just tested with the 1.2.0.201110222014 release that coming from nightly builds. 

The behavior is a little different, only the Eclipse UI is "loading", Windows UI is not freeze anymore.

But the right click take always 4/5 minutes to open the dialog.

I've tried to make a thread dump but I don't know how to do that (even when reading the wiki entry sorry).
Comment 5 Matthias Sohn CLA 2011-10-24 08:05:07 EDT
(In reply to comment #4)
> I've tried to make a thread dump but I don't know how to do that (even when
> reading the wiki entry sorry).

see e.g. http://wiki.eclipse.org/How_to_report_a_deadlock#Using_jvisualvm
Comment 6 Matthias Sohn CLA 2011-12-06 19:35:14 EST
Ping, please provide thread dumps when the hang occurs otherwise we can't find the root cause.
Comment 7 Nuk CLA 2011-12-07 08:31:37 EST
OK, I'll plan to make the dump asap
Comment 8 Carolyn MacLeod CLA 2011-12-19 12:48:20 EST
This is also happening to me. Note that I am on Win XP.
FYI, I tried the -consoleLog approach to getting a stack dump, and nothing happens when I press ctrl+break in the console. Used to work, long ago...
Comment 9 Remy Suen CLA 2011-12-19 12:53:31 EST
(In reply to comment #8)
> This is also happening to me. Note that I am on Win XP.
> FYI, I tried the -consoleLog approach to getting a stack dump, and nothing
> happens when I press ctrl+break in the console. Used to work, long ago...

Does using a Sun JDK with Visual VM extract something useful?
Comment 10 Carolyn MacLeod CLA 2011-12-19 13:12:27 EST
Created attachment 208575 [details]
Stack trace from Suspend

Didn't try it yet, but I will if necessary.
What I did just do is run eclipse-in-eclipse and press Suspend after trying to open context menu. Here (attached) is what I got (this is just the main thread. Let me know if you want any other).
Comment 11 Remy Suen CLA 2011-12-19 13:16:29 EST
(In reply to comment #10)
> Created attachment 208575 [details]
> Stack trace from Suspend

Thanks for the trace, Carolyn, that will do.

eclipse-in-eclipse [Eclipse Application]	
	org.eclipse.equinox.launcher.Main at localhost:4381 (Suspended)	
		Daemon System Thread [Finalizer] (Suspended)	
			Object.wait(long) line: not available [native method]	
			ReferenceQueue<T>.remove(long) line: not available	
			ReferenceQueue<T>.remove() line: not available	
			Finalizer$FinalizerThread.run() line: not available	
		Daemon System Thread [Reference Handler] (Suspended)	
			Object.wait(long) line: not available [native method]	
			Reference$Lock(Object).wait() line: not available	
			Reference$ReferenceHandler.run() line: not available	
		Thread [main] (Suspended)	
			WinNTFileSystem.getLastModifiedTime(File) line: not available [native method]	
			File.lastModified() line: not available	
			FileTreeIterator$FileEntry.getLastModified() line: 192	
			FileTreeIterator(WorkingTreeIterator).getEntryLastModified() line: 417	
			FileTreeIterator(WorkingTreeIterator).compareMetadata(DirCacheEntry) line: 636	
			FileTreeIterator(WorkingTreeIterator).isModified(DirCacheEntry, boolean) line: 665	
			IndexDiffFilter.include(TreeWalk) line: 171	
			AndTreeFilter$List.include(TreeWalk) line: 162	
			TreeWalk.next() line: 560	
			IndexDiff.diff(ProgressMonitor, int, int, String) line: 281	
			IndexDiff.diff() line: 225	
			CompareIndexWithHeadActionHandler.isStaged(Repository, IResource) line: 119	
			CompareIndexWithHeadActionHandler.isEnabled() line: 90	
			CompareIndexWithHeadAction(RepositoryAction).isEnabled() line: 125	
			CompareIndexWithHeadAction(RepositoryAction).selectionChanged(IAction, ISelection) line: 102	
			ObjectPluginAction(PluginAction).refreshEnablement() line: 206

Matthias, my suspicions about CompareIndexWithHeadActionHandler in comment 3 seems to be confirmed by Carolyn's thread dump.
Comment 12 Jens Baumgart CLA 2011-12-20 06:34:34 EST
Fix proposed: http://egit.eclipse.org/r/4862
Comment 13 Matthias Sohn CLA 2011-12-20 11:36:15 EST
merged as 093cc67cb66ad102cf4c7fa046f5223962540aa3
Comment 14 Carolyn MacLeod CLA 2011-12-20 12:02:59 EST
Wonderful! This will make a real difference for me. Can't wait to try it. Please change status to "verified" when the fix is available in an I build.
Thanks!