DESCRIPTION

Fix GenerateHistoryJob running forever

GenerateHistoryJob can run forever and therefore the History
view leaks memory. This can happen when the find toolbar
is enabled (incremental loading) and the number of commits is
greater than the maximum number to display.

Bug: 425691
Change-Id: Ie011864f66cc2b1f50978f0732edf9b1e5f84ea4
Signed-off-by: Alivia Ritter xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2014-01-15 01:05:12.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/5472/

-------------------------------------
author: Kaeden Tapia
date: 2014-01-15 01:20:37.000000000

Patch Set 1: Code-Review-1

Actually, I think I misunderstood the meaning of the boolean "incomplete".

-------------------------------------
author: Brenden Conley
date: 2014-01-15 01:45:20.000000000

Patch Set 1: Verified-1

Build Failed 

https://hudson.eclipse.org/egit/job/egit.gerrit/5472/ : ABORTED

-------------------------------------
author: Carlie Harper
date: 2014-01-20 17:13:03.000000000

Patch Set 1: Code-Review-1

(1 comment)

Line:101, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java -> No, this is wrong, because this statement is there to limit the size of shown objects to about maxCommits.

But clearly incomplete = true is not true always in case maxCommits > 0 && loadedCommits.size() > maxCommits. 
A check is missing if all commits are loaded. This is unfortunately not easily done with the SWTCommitList.

A workaround is to check if no new commits were loaded in the current invocation of the GenerateHistoryJob (it is retriggered after rendering the table from a Listener added in the Consgtructor of CommitGraphTable, and the retriggering is done to implement the incremental loading) and step out of the loop before this check for incomplete is done. Then the method updateUI in GenerateHistoryJob will not render the UI again and not start the endless loop anymore.

I have a fix for that locally. If you agree I would rather push it to a new Gerrit Change as it is quite different from this Change.

-------------------------------------
author: Kaeden Tapia
date: 2014-01-20 18:23:22.000000000

Patch Set 1:

(1 comment)

Line:101, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java -> Thanks for looking into this.

"I have a fix for that locally. If you agree I would rather push it to a new Gerrit Change as it is quite different from this Change."

Yes, you can push it to a new Gerrit change. I also have an updated patch that I could push to this current Gerrit change but I'll wait for your patch because your solution will most likely be better.

-------------------------------------
author: Carlie Harper
date: 2014-01-21 09:32:07.000000000

Patch Set 1:

I proposed an alternative patch at https://git.eclipse.org/r/20858

-------------------------------------
