Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] EGit blocking main thread?

I pushed a fix https://git.eclipse.org/r/#/c/34281/ please try if this helps on your repository

--
Matthias

On Thu, Oct 2, 2014 at 9:07 AM, Duft Markus <Markus.Duft@xxxxxxxxxxxxxxxx> wrote:

Hey,

 

Thanks, that’s the proposed solution I expected ;)

 

Cheers,

Markus

 

Von: Baumgart, Jens [mailto:jens.baumgart@xxxxxxx]
Gesendet: Donnerstag, 2. Oktober 2014 09:03
An: Duft Markus; Matthias Sohn
Cc: EGit developer discussion (egit-dev@xxxxxxxxxxx)
Betreff: RE: [egit-dev] EGit blocking main thread?

 

Hi,

 

I think if .SubmoduleWalk.forIndex can take such a long time, it should not be done in the UI thread.

 

        at org.eclipse.jgit.submodule.SubmoduleWalk.forIndex(SubmoduleWalk.java:95)

        at org.eclipse.egit.ui.internal.staging.StagingViewContentProvider.inputChanged(StagingViewContentProvider.java:326)

Instead, the content provider should start a Job for the calculation and display something like “Loading…”.

 

Regards

 

Jens

 

From: egit-dev-bounces@xxxxxxxxxxx [mailto:egit-dev-bounces@xxxxxxxxxxx] On Behalf Of Duft Markus
Sent: Donnerstag, 2. Oktober 2014 08:43
To: Matthias Sohn
Cc: EGit developer discussion (egit-dev@xxxxxxxxxxx)
Subject: Re: [egit-dev] EGit blocking main thread?

 

Hey,

 

Sorry, forgot to mention that; It /is/ the release version, but has a two line patch on the StagingView:

 

--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java

+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java

@@ -734,6 +734,8 @@

                              GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)

                                                              .applyTo(commitAndPushButton);

 

+                             commitAndPushButton.setVisible(false);

+

                              this.commitButton = toolkit.createButton(commitButtonsContainer,

                                                              UIText.StagingView_Commit, SWT.PUSH);

                              commitButton.setImage(getImage(UIIcons.COMMIT));

 

Cheers,

Markus

 

Von: Matthias Sohn [mailto:matthias.sohn@xxxxxxxxx]
Gesendet: Donnerstag, 2.
Oktober 2014 08:37
An: Duft Markus
Cc: EGit developer discussion (
egit-dev@xxxxxxxxxxx)
Betreff: Re: [egit-dev] EGit blocking main thread?

 

On Thu, Oct 2, 2014 at 7:33 AM, Duft Markus <Markus.Duft@xxxxxxxxxxxxxxxx> wrote:

Hey,

 

Operating on a relatively large repository (1.4G working tree, 1.8G repo) I was working happily, until suddenly my eclipse started hanging violently. It would recover every 10 – 20 seconds so that I can type another half a line, and after that (when saving for example, but also without saving) it would hang again. I jstack’d a little, and found out that EGit/JGit are running in the main thread... is this intention? I don’t think that’s a good idea, no?

 

"main" prio=10 tid=0x00007fd7e4024000 nid=0x2fba runnable [0x00007fd7eb296000]

   java.lang.Thread.State: RUNNABLE

        at sun.misc.Unsafe.getInt(Native Method)

        at sun.security.provider.ByteArrayAccess.b2iBig64(ByteArrayAccess.java:274)

        at sun.security.provider.SHA.implCompress(SHA.java:122)

        at sun.security.provider.DigestBase.engineUpdate(DigestBase.java:133)

        at java.security.MessageDigest$Delegate.engineUpdate(MessageDigest.java:568)

        at java.security.MessageDigest.update(MessageDigest.java:313)

        at org.eclipse.jgit.dircache.DirCacheEntry.<init>(DirCacheEntry.java:163)

        at org.eclipse.jgit.dircache.DirCache.readFrom(DirCache.java:483)

        at org.eclipse.jgit.dircache.DirCache.read(DirCache.java:411)

        at org.eclipse.jgit.dircache.DirCache.read(DirCache.java:194)

        at org.eclipse.jgit.dircache.DirCache.read(DirCache.java:166)

        at org.eclipse.jgit.lib.Repository.readDirCache(Repository.java:1021)

        at org.eclipse.jgit.submodule.SubmoduleWalk.forIndex(SubmoduleWalk.java:95)

        at org.eclipse.egit.ui.internal.staging.StagingViewContentProvider.inputChanged(StagingViewContentProvider.java:326)

        at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:276)

        at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1690)

        at org.eclipse.egit.ui.internal.staging.StagingView$43.run(StagingView.java:2095)

        at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:164)

        at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer.java:158)

        at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)

        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)

        - locked <0x00000007ce1ffe38> (a org.eclipse.swt.widgets.RunnableLock)

        at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3717)

        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3366)

        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)

        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)

        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)

        at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)

        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)

        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)

        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)

        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)

        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)

        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)

        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)

        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:606)

        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)

        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)

        at org.eclipse.equinox.launcher.Main.run(Main.java:1450)

        at org.eclipse.equinox.launcher.Main.main(Main.java:1426)

 

scanning through the other threads, I found this one, which seems to be the cause for the sync exec

 

"Worker-51" prio=10 tid=0x00007fd614002000 nid=0x7208 in Object.wait() [0x00007fd6549b5000]

   java.lang.Thread.State: TIMED_WAITING (on object monitor)

        at java.lang.Object.wait(Native Method)

        at org.eclipse.ui.internal.Semaphore.acquire(Semaphore.java:43)

        - locked <0x00000007ce1ffe08> (a org.eclipse.ui.internal.Semaphore)

        at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:168)

        at org.eclipse.swt.widgets.Display.syncExec(Display.java:4491)

        at org.eclipse.egit.ui.internal.staging.StagingView.syncExec(StagingView.java:2427)

        at org.eclipse.egit.ui.internal.staging.StagingView.reload(StagingView.java:2066)

        at org.eclipse.egit.ui.internal.staging.StagingView$2.indexDiffChanged(StagingView.java:415)

        at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.notifyListeners(IndexDiffCacheEntry.java:468)

        at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.access$10(IndexDiffCacheEntry.java:460)

        at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry$5.run(IndexDiffCacheEntry.java:389)

        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

 

Any thoughts, insights? BTW Eclipse is 4.4.1, EGit/JGit are 3.5.0 release.

 

looks like you don't have the final 3.5 release since this stacktrace doesn't match that version,

StagingView doesn't call syncExec on line 2427 in 3.5.0.201409260305-r :

 

 

--

Matthias

Salomon Automation GmbH | Friesachstrasse 15 | 8114 Friesach bei Graz | Austria
Registered Office: Friesach bei Graz | Commercial Register: 49324 K | VAT no. ATU28654300
Commercial Court: Landesgericht für Zivilrechtssachen Graz

Salomon Automation GmbH | Friesachstrasse 15 | 8114 Friesach bei Graz | Austria
Registered Office: Friesach bei Graz | Commercial Register: 49324 K | VAT no. ATU28654300
Commercial Court: Landesgericht für Zivilrechtssachen Graz


Back to the top