-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an option to instruct equinox to clean the resolver state #448
Comments
This reminds me of eclipse-pde/eclipse.pde#775 (comment). |
Right, with commit 907ec00 I see no need for this mechanism. P2 can already force a re-resolve of all bundles and should with that commit. Any issues not fixed by that approach will not be fixed by this new flag to tell the framework itself to re-resolve all installed bundles on start. |
I'm not sure this assertion is true. e.g. this only happens when simple configurator has started and then refresh everything but the "bad" things happen before. There is still a big difference between an empty |
If we retain the bundle data areas and the bundle ids then that means we are not really starting with an empty |
That's for sure, the resolver/state recovery should just be like if it where empty. So at some point I assume there will be something like
that should become
Maybe that's the intention and maybe it works in many cases but I'm observing different behavior. I'm currently analyzing a larger wiring problem (using Eclipse 2023-03 where the fix should be included) and what I see is the following:
So basically I end up with a completely different state with completely different errors depending of if there is a cached state or not, the same can be reproduced when I use the director on the commandline, installing into a fresh extracted eclipse results in state (3), if I ever have started eclipse before it it state (2). |
I don't believe only re-resolving all bundles by discarding the wiring state will solve that problem because that is what p2 is doing already. Doing a clean start causes all bundles to be re-installed by p2 and they end up in a different order from your state (2). My observation is that the bundles are installed in alphabetical BNS order. Unfortunately the OSGi specification puts some priority on install order with respect to what providers are preferred. I suspect that order difference is what causes it to "work" for you on a clean start. With that in mind, I don't think discarding the wiring state is going to make this work because we will still have the same problematic install order as before. |
If order matters its probably not a good idea that simple configurator order them alphabetically (I assume order of I just don't have a clue then how one should be able to analyze this, strange enough clean gives often a better result that incremental install. Maybe then installing new bundles should not result in refresh the state but also reassign bundle ids and simply move their bundle data to the new id if it has changed. |
That will break OSGi compliance since bundle IDs are supposed to be constant. |
Also between restarts? Obviously a clean do not keep the ids constant... |
Yes, between restarts IDs are persistent. Clean follows the specified behavior for https://docs.osgi.org/javadoc/osgi.core/8.0.0/org/osgi/framework/Constants.html#FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT Where first init means the first call to |
@tjwatson thanks for the explanation and the hint about bundle IDs and I think there is really causing the issue, I sadly have not a "simple small reproducer" I can share but will try to explain the problem on a high level in the hope it might still be useful.
So what seems to happen here is that batchsize is actually to small but it already takes very long so I'm not convinced its a good idea to raise it. Instead I'm wondering, if the resolver fails with use-constraint violation, if it would be feasible if the resolver starts one last attempt by refreshing the wiring for the conflicting providers? |
I made further experiments now to further analyze the problem and it really seems to be the problem that the resolver seem not to "partitioning" be bundles correctly. I have now written a "fix wires" command that do the following:
This finally leads to a resolved state! @tjwatson I probably can share the application with you that reproduces the problem if you are interested in an analysis, just let me know. |
I now created a PR here to mitigate the issue: this solves the problem in my tests when I see unresolved/conflicting requirements that are actually resolvable. |
This is great analysis. I think this is a workable "workaround". I do wish we could have a testcase added to exercise the approach though. Is that at all feasible to add? If we had that it may help others analyze why the resolver isn't partitioning the bundles correctly. Perhaps the batch size approach isn't working well in this scenario? |
@tjwatson if it is fine for you I can contact you directly and elaborate how to to share the test-case it is quite large and contains some custom bunldes so I'm not 100% sure how to best make it a standalone test-case. |
I now started to try creating a local test-case in
|
@tjwatson I was able to solve this by removing all mentions of EDIT: Found the necessary steps in |
You could look at |
This issue has been inactive for 180 days and is therefore labeled as stale. |
Currently if one performs an install of new software it can happen that:
many of the cases (except there are really incompatible installs) can be solved by starting the framework with
-clean
option but this does not only clean the resolver state but nay persisted state and is a manual action to perform. Instead P2 should be able to instruct the framework to remove clear the current resolved state and start from fresh.The least intrusive way seem to have a marker file that is stored at
configuration/org.eclipse.osgi
e.g..refreshstate
, whenever equinox find that file it should delete it and throw away its previously cached state.@tjwatson do you think this is suitable, what would be the best place to start with such implementation?
The text was updated successfully, but these errors were encountered: