Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366685

Summary: Checkstyle Builder hangs in Egit code
Product: [Technology] EGit Reporter: Jens Borgland <jens.borgland>
Component: CoreAssignee: Project Inbox <egit.core-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: critical    
Priority: P3 CC: dariusz.luksza, jens.baumgart, robin.rosenberg
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Thread dump retrieved through JMX (using JConsole) none

Description Jens Borgland CLA 2011-12-14 07:09:38 EST
Build Identifier: 20110218-0911

Since we migrated from Subversion to Git (and I started using Egit) Checkstyle hangs indefinetely (on 75%). A thread dump shows that the build seems to be stuck withing Egit code. Starting Eclipse with the -clean flag did not help.

Eclipse Helios Service Release 2
Build id: 20110218-0911
Eclipse Checkstyle Plug-in: 5.5.0.201111092104
Eclipse EGit: 1.1.0.201109151100-r

Reproducible: Always

Steps to Reproduce:
1. Enable Checkstyle for a Git project
2. Perform a build
Result: The build hangs and Eclipse has to be forcefully shut down.
Comment 1 Jens Borgland CLA 2011-12-14 07:12:00 EST
Created attachment 208375 [details]
Thread dump retrieved through JMX (using JConsole)
Comment 2 Jens Baumgart CLA 2011-12-20 11:12:09 EST
It seems something time consuming is happening here:

org.eclipse.egit.core.synchronize.GitSyncCache.getAllData(GitSyncCache.java:50)
org.eclipse.egit.core.synchronize.GitResourceVariantTreeSubscriber.init(GitResourceVariantTreeSubscriber.java:81)
org.eclipse.egit.core.internal.GitRepositoryProviderType.getSubscriber(GitRepositoryProviderType.java:48)
org.eclipse.team.core.RepositoryProvider.getSubscriber(RepositoryProvider.java:864)
net.sf.eclipsecs.core.projectconfig.filters.FilesInSyncFilter.accept(FilesInSyncFilter.java:56)
Comment 3 Dariusz Luksza CLA 2011-12-21 16:28:58 EST
I assume that checkstyle process hangs on some test cases, with one exactly ?

From given thread dumps I can only say that synchronization refresh process was started and it is doing some massive diff calculations. Such operations may happen when there is lots of changes to be collected, but AFAIK our test cases doesn't cover such scenario. Any hints when it hangs will be helpful.
Comment 4 Jens Borgland CLA 2011-12-22 04:55:09 EST
I've had it running for close to 24 hours now. It doesn't seem to be completely stuck this time (if a repeatedly re-check the status of the thread the WorkingTreeIteration seems to be alternating between computeLength and computeHash) but the performance isn't really what I would expect...

It is completely repeatable with the project I'm working on. I tried setting up a new Eclipse workspace and importing the project again (after making a new git clone) but it made no difference.

The project is a Java application (approx. 350 KLOC, and of course some other resources like some binaries, XML files etc). My Git clone is about 1.4 GB on disk.

Egit works like a charm in all other respects.

To me (who doesn't know a thing about how Egit works internally) it seems strange that it would need to do any diff calculations at all? A simple "git status" or similar would provide the list of files that should be included, right?

(In reply to comment #3)
> I assume that checkstyle process hangs on some test cases, with one exactly ?
> 
> From given thread dumps I can only say that synchronization refresh process was
> started and it is doing some massive diff calculations. Such operations may
> happen when there is lots of changes to be collected, but AFAIK our test cases
> doesn't cover such scenario. Any hints when it hangs will be helpful.
Comment 5 Robin Rosenberg CLA 2012-10-06 16:45:14 EDT
Is this still a problem? A lot of work was removed with 342de38e57e3052d3d2f12e93d629bdc63f123be
Comment 6 Robin Rosenberg CLA 2013-02-09 00:45:32 EST
Doesn't hang here, and if it did it would be an issue for checkstyle as it should not hang on a problem, but rather report it.