Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340948

Summary: [planner] Provide a flag to force the resolver to run until it has found the optimal solution.
Product: [Eclipse Project] Equinox Reporter: Krzysztof Daniel <krzysztof.daniel>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: leberre, pascal
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Krzysztof Daniel CLA 2011-03-25 08:21:52 EDT
As per bug 301446 and bug 336967 P2 does not have to return optimal set of units to be loaded.

One of those bugs allowed for changing the timeout (the number of tries). This still does not solve the problem. How can I know if particular set of plugins is the optimal one? If I increase the timeout and get the same solution, it means nothing. Maybe if I set the timeout to timeout+1, it could be better.

P2 should be able to work in a strict mode to find an optimal set of plugins. No matter how much time it takes.
Comment 1 DJ Houghton CLA 2011-03-25 08:25:10 EDT
The new version of SAT4J (2.3) contains new API which will tell us whether or not the solution returned is optimal.
Comment 2 Pascal Rapicault CLA 2011-03-27 09:59:12 EDT
As a reminder, the dependency resolution problem is NP-complete. The idea behind the timeout is to avoid having to exhaust the search space which can be very long and still provide a consistent answer for all users.
Your scenarios are worsen by the fact that all the IUs are installed optionally which massively increase the search space.
Comment 3 Thomas Watson CLA 2011-06-08 11:28:34 EDT
Move all 3.8 bugs to Juno.
Comment 4 Pascal Rapicault CLA 2011-06-10 22:10:53 EDT
At this point I don't know if this is a flag that is configured as a property in the profile or a command line arg. I would be tempted to think that this is a profile flag to ensure consistency across resolutions. 
If we go down this path we should think about how we want to provide feedback to the user as it is possible that the resolution would last several minutes as we have seen in the competitions (though the instances were much bigger).
Comment 5 Pascal Rapicault CLA 2011-06-10 22:11:09 EDT
Btw, feel free to take that off Juno.
Comment 6 Daniel Le Berre CLA 2011-06-11 02:12:07 EDT
The main point is: who is the expected user of that feature?

I do not think we target the end user here, rather people using p2 to build their product, right?

In that case, I guess that a command line flag is the best solution.

I am not sure that the profile should contain that information (i.e. to have people who would like to enforce that an optimal solution is computed each time).
Comment 7 Pascal Rapicault CLA 2011-06-11 11:22:31 EDT
> In that case, I guess that a command line flag is the best solution.
   My worry about command line flag is consistency. Sometimes you start with it, sometimes without it.
Another important question to answer from the resolver / planner point of view is what happens if I alternate resolution with the flag and without the flag for the same instance?
Comment 8 Lars Vogel CLA 2019-11-14 03:25:40 EST
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.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.