| Summary: | resolve process must fail when hook throws exception or is unregistered. | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Thomas Watson <tjwatson> | ||||||
| Component: | Framework | Assignee: | Thomas Watson <tjwatson> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | glyn.normington, hargrave | ||||||
| Version: | 3.7 | ||||||||
| Target Milestone: | 3.7 M6 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Thomas Watson
Created attachment 188092 [details]
patch and test changes
In order to implement this in a reasonable way I had to simplify the way we select singletons. Previously we used a two pass resolver algorithm. In the first pass we would treat all bundles as non-singleton and get a reference count to all singleton bundles. Then we would try to select the version of each singleton that contained the highest reference count. The idea was that this version would allow more bundles to resolve. Then we would unresolve the unselected singletons from the first pass and start a second pass to resolve the bundles again.
The problem with this approach is that it uses the State to record interim decisions between the first pass and the second pass. So if a hook throws an exception during the second pass then the State would be left in a weird state with the interim decisions about what bundles are resolved. This patch ensures that we do not record any resolution data until the end after the final resolution decisions have been made. This way if a hook throws an exception then the state is still intact and has not been changed. I had to add a new ResolverHookException so I could throw this from the resolver to the state and then report the error in the StateDelta. This was necessary because the State resolver process actually has two parts. 1) to unresolve a graph of bundles 2) to attempt to resolve the set of unresolved bundles in the state. ResolverHooks only participate in the second part. We need to always have a StateDelta even when a hook fails so that we can correctly reflect the unresolved bundles from step 1 in the framework.
I had to update the testcases to reflect the different singleton selection algorithm.
Created attachment 188094 [details]
patch and test changes
previous patch contained extra changes to BundleHost unrelated to this fix.
patch released. |