Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 373077 - Re-indexing blocks user
Summary: Re-indexing blocks user
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 1.3   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 2.0-M2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-02 07:44 EST by Robin Rosenberg CLA
Modified: 2012-05-02 12:08 EDT (History)
6 users (show)

See Also:


Attachments
Multiple re-indexing jobs (5.12 KB, image/gif)
2012-03-02 09:23 EST, Robin Rosenberg CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Rosenberg CLA 2012-03-02 07:44:49 EST
Re-indexing is run from time to time and that in itself may not be an issue, but it is so extreemly slow that it makes using egit a pain.

Can we turn it off? 

Do we even need it?
Comment 1 Robin Rosenberg CLA 2012-03-02 09:20:11 EST
Has anyone considered setting the priority to DECORATE ?

Does https://bugs.eclipse.org/bugs/show_bug.cgi?id=333204 have anything to do with this?

I have also noted that there sometimes is a ton of Re-indexing operations
running for the same repository. Most (or all) have the comment "Cancel Requested" attached to the name.

The blocking I mentioned may not be a "hard" block like locking, but in practice the workspaces is unusable until the re-index jobs are done and this may take a minute or two.

I have the refresh on startup enabled, so a refresh, often followed by a build
frequently happens when I launch Eclipse. How can we stop the re-indexing from
running during builds and delay it until nothing heavy is going on?
Comment 2 Robin Rosenberg CLA 2012-03-02 09:23:24 EST
Created attachment 211965 [details]
Multiple re-indexing jobs

Not sure why the blank parts appear here, but it's the same job re-appearing many times.
Comment 3 Robin Rosenberg CLA 2012-03-02 09:27:30 EST
In IndexDiffCacheEntry there is this code.

	private void scheduleReloadJob(final String trigger) {
		if (reloadJob != null)
			reloadJob.cancel();

I'm missing reloadJob.join() here.
Comment 4 Matthias Sohn CLA 2012-04-03 10:19:20 EDT
merged as 6bff046874e3b51dcef78a65fe8a2631bdd7e3d8
Comment 5 Jens Baumgart CLA 2012-04-03 10:24:50 EDT
(In reply to comment #3)
> In IndexDiffCacheEntry there is this code.
> 
>     private void scheduleReloadJob(final String trigger) {
>         if (reloadJob != null)
>             reloadJob.cancel();
> 
> I'm missing reloadJob.join() here.

You can't join here because this would make the method synchronous.
Synchronous execution would cause dead locks.

There was a bug in the cancellation handling. I proposed a fix for this:

https://git.eclipse.org/r/5522
Comment 6 Jens Baumgart CLA 2012-04-03 10:29:53 EDT
(In reply to comment #0)
> Re-indexing is run from time to time and that in itself may not be an issue,
> but it is so extreemly slow that it makes using egit a pain.
> 
> Can we turn it off? 
> 
> Do we even need it?

Yes we need it :-)
IndexDiffCacheEntry caches the IndexDiff for a given repository. This cached IndexDiff is e.g. used for decoration and for staging view and improved decoration performance drastically.

Behaviour of IndexDiffCacheEntry:
The IndexDiff is recalculated completely on refsChanged events.
The IndexDiff is recalculated partly on resourceChanged events.
Comment 7 Markus Keller CLA 2012-05-01 12:59:17 EDT
Just a heads up: I think the fix for this bug triggered a bug in the jobs framework (bug 378156), which causes auto-builds to be delayed forever after certain EGit operations (reset, revert commit).

The EGit fix looks correct, but if the platform bug can't be fixed promptly, then this problem will hurt EGit users, probably also in maintenance builds (3.6.x, 3.7.x).