Bug 479926 - Persistent builder infos get lost when builders were not initialized
Summary: Persistent builder infos get lost when builders were not initialized
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 4.5   Edit
Hardware: PC Mac OS X
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Platform-Resources-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-16 04:29 EDT by Karsten Thoms CLA
Modified: 2022-07-13 20:03 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karsten Thoms CLA 2015-10-16 04:29:18 EDT
The Workbench's SaveManager saves and restores the persistent state of builders. Only if this state is present, an incremental build after start of Eclipse is possible. Otherwise builders will perform a full build.

If the auto build is disabled, it can happen that builders were never initialized, which will lead to the problem that no builder state is persisted on closing the workbench. In this case it is expected that the previous state is preserved.

The following steps will reproduce the problem:
1) Start a runtime Eclipse workspace
2) Create a simple Java project
3) Disable auto-build
4) Set breakpoint on WorkspaceTreeReader_2#readTree#line122
   setBuilderInfos(builderInfos);
5) Restart Eclipse
   => Process stops at breakpoint, the variable 'builderInfos' is not empty
6) Continue and wait for start of Eclipse
7) Restart Eclipse again without triggering any build
   => Process stops at breakpoint, the variable 'builderInfos' *is empty*
8) Set breakpoint at BuildManager#initializeBuilder#line876
   if (tree != null)
9) Continue and trigger a build
   => Process stops at breakpoint, variable 'tree' is null
10) Set breakpoint at BuildManager#basicBuild#line161
11) Continue
   => Process stops at breakpoint, the BuildManager decides to perform a full build for the builder

When the BuildManager initializes a builder after start of Eclipse, it will get the last persistent state from the loaded tree (.metadata/plugins/org.eclipse.core.resources/.root/NNN.tree)

If a builder was initialized by BuildManager#initializeBuilder, its latest ElementTree will be stored by the SaveManager into the persisted tree file. But the steps described above will lead to the situation, that builders are never initialized, and so there is no state to save.

Since nothing happened between loading the tree and storing it, it is expected that the last builder state is preserved. The SaveManager might remember the last loaded builder state and store it back for the case that builders were not initialized.

The problem was observed in a large project, where it is a policy to disable auto-build since it lasts several minutes for a full build of the projects in the workspace. The issue leads to the problem that after a plugin update, which usually happens once a day for each developer, the workbench restarts without a build and drops the builder persistent state. After restart, an unnecessary full build is performed, which blocks developers for minutes.
Comment 1 Eclipse Genie CLA 2020-08-20 04:27:11 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.
Comment 2 Sergio Otero CLA 2022-07-13 07:41:02 EDT
I can confirm that this problem still happens on Eclipse 2022-06
Apart from disabling auto-build, it also happens easily as:

- Create a simple java project
- Close Eclipse: ok
- Open Eclipse
- Close Eclipse: builders info is lost
- Open Eclipse
- Change java program: innecesary full rebuild

As suggested, a builder that hasn't been initialized should preserve it last state, not being emptied
Comment 3 Karsten Thoms CLA 2022-07-13 20:03:27 EDT
Reopened on Sergio's request