Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344090 - Team > Synchronize action results in auto build
Summary: Team > Synchronize action results in auto build
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform Team Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-28 04:26 EDT by Deepak Azad CLA
Modified: 2019-09-12 17:36 EDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Deepak Azad CLA 2011-04-28 04:26:00 EDT
- Select a few projects in Package Explorer (I had o.e.jdt.core, o.e.jdt.ui etc)
- Team > Synchronize
- Keep 'Progress view' open in EclipseYou can see the build job being triggered every once in a while for a very short duration. (This causes flickering in the view which is a bit annoying)

- Run eclipse with -debug option and set the following options in the .options file 
-----------------------------------------------------------------------------
# Turn on debugging for the org.eclipse.core.resources plugin.
org.eclipse.core.resources/debug=true

# Reports the start and end of all builder invocations
org.eclipse.core.resources/build/invoking=true

# Reports the start and end of build delta calculations
org.eclipse.core.resources/build/delta=true

# For incremental builds, displays which builder is being run
# and because of changes in which project.
org.eclipse.core.resources/build/needbuild=true

# Prints a stack trace every time an operation finishes that requires a build
org.eclipse.core.resources/build/needbuildstack=true
------------------------------------------------------------------------------

- Synchronize a few projects with CVS 
=> I got the following debug output. The Auto-Build does not do anything, but is invoked multiple times. Plus I am just synchronizing and not modifying any resources, why should an Auto build be triggered? Is there a valid reason for this behavior which I am not aware of ?

------------------------------------------------------------------------------
Thu Apr 28 13:43:05 IST 2011 - [Worker-19] Auto-Build requested, needsBuild: false state: 0 delay: 100
Thu Apr 28 13:43:05 IST 2011 - [Worker-16] Auto-Build requested, needsBuild: false state: 1 delay: 100
Thu Apr 28 13:43:05 IST 2011 - [Worker-20] Auto-Build requested, needsBuild: false state: 4 delay: 100
Thu Apr 28 13:43:06 IST 2011 - [Worker-19] Auto-Build requested, needsBuild: false state: 0 delay: 100
Thu Apr 28 13:43:06 IST 2011 - [Worker-21] Auto-Build requested, needsBuild: false state: 4 delay: 100
Thu Apr 28 13:43:10 IST 2011 - [Worker-19] Auto-Build requested, needsBuild: false state: 0 delay: 100
Thu Apr 28 13:43:10 IST 2011 - [Worker-16] Auto-Build requested, needsBuild: false state: 4 delay: 100
Thu Apr 28 13:43:12 IST 2011 - [Worker-19] Auto-Build requested, needsBuild: false state: 0 delay: 100
Thu Apr 28 13:43:12 IST 2011 - [Worker-16] Auto-Build requested, needsBuild: false state: 4 delay: 100
Thu Apr 28 13:43:14 IST 2011 - [Worker-19] Auto-Build requested, needsBuild: false state: 0 delay: 100
Thu Apr 28 13:43:14 IST 2011 - [Worker-20] Auto-Build requested, needsBuild: false state: 4 delay: 100
Thu Apr 28 13:43:16 IST 2011 - [Worker-19] Auto-Build requested, needsBuild: false state: 0 delay: 100
Thu Apr 28 13:43:16 IST 2011 - [Worker-21] Auto-Build requested, needsBuild: false state: 4 delay: 100
Thu Apr 28 13:44:05 IST 2011 - [Worker-19] Auto-Build requested, needsBuild: false state: 0 delay: 100
Thu Apr 28 13:44:05 IST 2011 - [Worker-20] Auto-Build requested, needsBuild: false state: 4 delay: 100
Thu Apr 28 13:44:07 IST 2011 - [Worker-19] Auto-Build requested, needsBuild: false state: 0 delay: 100
Thu Apr 28 13:44:07 IST 2011 - [Worker-21] Auto-Build requested, needsBuild: false state: 4 delay: 100
Thu Apr 28 13:44:08 IST 2011 - [Worker-19] Auto-Build requested, needsBuild: false state: 0 delay: 100
Thu Apr 28 13:44:08 IST 2011 - [Worker-20] Auto-Build requested, needsBuild: false state: 4 delay: 100
Thu Apr 28 13:44:16 IST 2011 - [Worker-19] Auto-Build requested, needsBuild: false state: 0 delay: 100
Thu Apr 28 13:44:16 IST 2011 - [Worker-20] Auto-Build requested, needsBuild: false state: 1 delay: 100
Thu Apr 28 13:44:16 IST 2011 - [Worker-20] Auto-Build requested, needsBuild: false state: 4 delay: 100
-------------------------------------------------------------------------------
Comment 1 Dani Megert CLA 2011-04-28 04:36:02 EDT
Deepak,
- are you sure this only happens with the Synchronize view?
- do you have background sync enabled?
- do you also see this in older versions?
Comment 2 Deepak Azad CLA 2011-04-28 05:10:21 EDT
(In reply to comment #1)
> Deepak,
> - are you sure this only happens with the Synchronize view?
Yes! The debug messages come only when Team > Synchronize is invoked, plus this happens every time.

> - do you have background sync enabled?
Do you mean after invoking Team > Synchronize does the synchronize job runs in background or a dialog comes up ? It runs in the background.

> - do you also see this in older versions?
Haven't debugged with older versions today, but me and few others have been seeing the building workspace job in progress view whenever Team > Synchronize is invoked for a long long time now.
Comment 3 Deepak Azad CLA 2011-04-28 05:21:54 EDT
Just tried with 3.6 - I see the same debug messages. So the behavior is not new.
Comment 4 James Blackburn CLA 2011-05-03 04:44:12 EDT
Interesting. The auto-build is scheduled because the workspace thinks the ws tree has changed.  Auto-build is scheduled at the end of a top-level operation, see: 
   Workspace#endOperation -> buildManager.endTopLevel(hasTreeChanges) -> autoBuidlJob.build(needsBuild).

Note: even though the auto-build is requested multiple times, only one will be invoked. 

The fact that there are so many requests, indicates the team provider isn't batching resource changes in a workspace operation.  It should do this for performance, to minimize the frequency of resource deltas firing.
Comment 5 Deepak Azad CLA 2011-05-03 05:03:02 EDT
(In reply to comment #4)
> Interesting. The auto-build is scheduled because the workspace thinks the ws
> tree has changed.  Auto-build is scheduled at the end of a top-level operation,
> see: 
>    Workspace#endOperation -> buildManager.endTopLevel(hasTreeChanges) ->
> autoBuidlJob.build(needsBuild). 

Just curious, what changes in the workspace as a result of a synchronize operation ? Note that I am not talking about accepting any changes, it is only a synchronize. I was expecting no builds should be requested :)
Comment 6 James Blackburn CLA 2011-05-03 05:10:39 EDT
(In reply to comment #5)
> Just curious, what changes in the workspace as a result of a synchronize
> operation ? Note that I am not talking about accepting any changes, it is only
> a synchronize. I was expecting no builds should be requested :)

I would guess the Team synch bytes on the resource... Though this may not be the only change.  It would be worth looking at the resource delta generated as part of the sync operation.
Comment 7 Dani Megert CLA 2011-10-28 03:37:44 EDT
Ping!
Comment 8 Deepak Azad CLA 2011-10-28 06:27:53 EDT
The bug was originally filed when the team provider was cvs, I don't know if things change for Git..
Comment 9 Tomasz Zarna CLA 2011-10-28 07:22:34 EDT
I'm seeing the same thing, however looking at the debug output I would assume that an auto-build was requested, but it never ran since "needsBuild" was "false". Not sure if the performance hit is significant in that case, Szymon?
Comment 10 Szymon Brandys CLA 2011-11-18 05:51:52 EST
That's expected. Each workspace operation schedules AutoBuildJob which if needsBuild=false does not trigger any build. I don't see any performance issue in the described case. A good practice is to batch workspace operations wherever possible though. Not high priority for me.
Comment 11 Marcos Antonio CLA 2014-07-08 22:00:00 EDT
Maybe this forum topic has some relation with this issue:

http://www.eclipse.org/forums/index.php/t/790020/

I think it is worth fixing this, although for some this might not be interpreted as a problem.
Comment 12 Lars Vogel CLA 2014-12-17 15:26:01 EST
(In reply to Marcos Antonio from comment #11)
> Maybe this forum topic has some relation with this issue:
> 
> http://www.eclipse.org/forums/index.php/t/790020/
> 
> I think it is worth fixing this, although for some this might not be
> interpreted as a problem.

This was fixed with Bug 439325. Maybe this bug can be marked as fixed? I leave that for someone from the platform.team to decide.
Comment 13 Eclipse Genie CLA 2019-09-12 17:36:56 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.