Bug 531555 - Investigate using a more relaxed schedulingRule for PDE Builders
Summary: Investigate using a more relaxed schedulingRule for PDE Builders
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.9 M2   Edit
Assignee: Mickael Istria CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks: 527212 550034
  Show dependency tree
 
Reported: 2018-02-22 15:20 EST by Mickael Istria CLA
Modified: 2021-01-27 04:55 EST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mickael Istria CLA 2018-02-22 15:20:09 EST
PDE Builders, at least ManifestConsistencyChecker and ExtensionPointSchemaBuilder, do use the workspace root as scheduling rule, preventing many other jobs or builders to run in paralllel.
We should investigate having them using a more relaxed scheduling rule, such as project+PDEModel.
Comment 1 Eclipse Genie CLA 2018-03-29 01:02:33 EDT
New Gerrit change created: https://git.eclipse.org/r/120397
Comment 2 Mickael Istria CLA 2018-04-24 10:40:33 EDT
Any chance the proposed patch can be reviewed for M7?
Comment 3 Lars Vogel CLA 2018-04-24 12:20:30 EDT
(In reply to Mickael Istria from comment #2)
> Any chance the proposed patch can be reviewed for M7?

Code change look simple. How can I test this patch?
Comment 4 Alexander Kurtakov CLA 2018-04-24 12:55:14 EDT
I don't see issues with this patch as all the builders don't seem to go outside of the project boundary. I would like to understand what do you mean by "project+PDEModel" though?
Comment 5 Mickael Istria CLA 2018-04-24 13:58:10 EDT
(In reply to Alexander Kurtakov from comment #4)
> I don't see issues with this patch as all the builders don't seem to go
> outside of the project boundary. I would like to understand what do you mean
> by "project+PDEModel" though?

I meant PDEState which is a singleton used by all PDE projects. Usage of this singleton is the reason why it seems safer so far to have the rule on all PDE projects so we avoid concurrent modifications of PDEState.
Comment 6 Vikas Chandra CLA 2018-04-27 05:34:59 EDT
Is someone looking at this?

Alex/Lars/Andrey?
Comment 7 Andrey Loskutov CLA 2018-04-27 05:53:35 EDT
I'm not sure how PDE computes extensions and plugins state. If this requires build to run, then the change is not OK, because for example the code in

org.eclipse.pde.internal.core.builders.ExtensionsErrorReporter.validateExtension(Element)

needs to know about extension points defined in other plugins, to check if the contribution of the current plugin is valid.

Same in org.eclipse.pde.internal.core.builders.PluginBaseErrorReporter.validatePluginIDRef(Element, Attr) which needs PluginRegistry to know the model of the referenced bundle.
Comment 8 Mickael Istria CLA 2018-04-27 05:55:58 EDT
(In reply to Andrey Loskutov from comment #7)
> If this requires build to run, then the change is not OK, because...

Why do you think this change would make these methods not functional?
Comment 9 Andrey Loskutov CLA 2018-04-27 05:58:47 EDT
(In reply to Mickael Istria from comment #8)
> (In reply to Andrey Loskutov from comment #7)
> > If this requires build to run, then the change is not OK, because...
> 
> Why do you think this change would make these methods not functional?

Because if the builders would now run in parallel AND PDE registry/model state depends on the build (this is where I need confirmation), the project A build might not see the results of project B build and so validation of "requires B" or "extends B's extension" will not work.
Comment 10 Mickael Istria CLA 2018-04-27 06:22:38 EDT
(In reply to Andrey Loskutov from comment #9)
> Because if the builders would now run in parallel AND PDE registry/model
> state depends on the build (this is where I need confirmation), the project
> A build might not see the results of project B build and so validation of
> "requires B" or "extends B's extension" will not work.

See the scheduling rule that was chosen. It includes all PDE projects, so with this, not 2 PDE projects should build in parallel.
That's a defensive approach specifically to avoid such issues, as long as we did not have the guarantee that we can modify safely the PDEState in parallel.

Also, the principle of parallel build implementations is that it builds projects according to the dependency graph: no project gets built before its dependencies. So as long as dependencies are correct (that's the topic of bug 532264), then we have the guarantee that the build of project B completes before build of project A start.
Comment 11 Mickael Istria CLA 2018-04-30 12:23:46 EDT
I just had another look at the code, and indeed, there is no guard that 2 PDE projects wouldn't run in parallel. I thought I did it, but the code says I didn't.
As we're not sure the PDE Model can handle parallel builds, I'll update the patch to a more constrained scheduling rule preventing 2 PDE projects to build in parallel.
Comment 12 Mickael Istria CLA 2018-04-30 18:13:23 EDT
(In reply to Mickael Istria from comment #11)
> I'll update the
> patch to a more constrained scheduling rule preventing 2 PDE projects to
> build in parallel.

https://git.eclipse.org/r/120397 got updated.
Comment 13 Vikas Chandra CLA 2018-05-03 01:09:17 EDT
Andrey, can you please look at the updated patch. If ok, it can be merged to M7. If this looks like a risky thing to do in late M7, we can move to 4.9
Comment 15 Lars Vogel CLA 2018-06-13 09:02:52 EDT
Mickael, please add to N&N for 4.9.
Comment 16 Eclipse Genie CLA 2018-06-14 10:00:17 EDT
New Gerrit change created: https://git.eclipse.org/r/124544
Comment 18 Vikas Chandra CLA 2018-07-31 09:54:04 EDT
Any way to verify this bug?