-
Notifications
You must be signed in to change notification settings - Fork 138
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
Fixed use case when bundle start level will be set within an bundle activator, test case FrameworkStartLevelImplTest #190
base: master
Are you sure you want to change the base?
Conversation
…icate it does not need to be 10+1
@karlpauls @cziegeler I added now a proposal for a fix of the test case. From my point of view there are two problems happening:
I found that by adding a huge number of debug messages. I will leave them in for your testing. If you would agree on change, I would remove all debug output again, and do some re-formatting of code to Felix code style. My tests are running fine, also the whole Felix framework tests did also work well. |
I'm not in the position to review this change, but I will state that the specification requires that the start-level value be persisted synchronously, but then the actual act of starting or stopping the bundle be done asynchronously in reaction to the bundle start-level being changed with If a bundle changes another bundles start-level during the start-level processing such that the bundle must be stopped or started according to the current start level then that operation must be queued up to happen asynchronously. That is until the current start-level framework setting is fully processed to the "final" start-level. Any bundles that have not been processed yet should use the synchronously persisted start-level value for the bundle. Any bundles that have already been processed by the framework start-level change operation will "catch-up" after the "final" framework start-level has be reached and processed. That is they will get the async job that got queued up run at this point to either stop/start the bundle according to the current state of the framework start-level and the bundle's start-level. |
Thanks a lot for your comment @tjwatson
If I get you right, than the test case is invalid, or? If I first set framework start level of 11 (lower than the changed 20-40) after bundle M has been running, and then AFTERWARDS go to 100 then it does work, bundle start order will be recalculated. I verified that with test case. I am unsure what shall happen if initial bundle start level is e.g. 12, bundle M will manipulate to 20-40, and framework start level is 15. We got this ERROR message
Is that ERROR ok if we change the bundle start level during the phase to go to request framework start level? |
I don't believe that error is OK. In my opinion the framework should avoid logging an error in this case and move on in the processing of the rest of framework start-level changes. But that is about it. It sounds like the framework is acting upon a snap-shot of the bundle start-levels for the duration of the framework start-level processing. Some bundle's start-levels may change that make it impossible to actual start the bundle at the previously determined bundle start-level snap-shot, because it has changed synchronously. From a spec perspective, I think this is fine as long as the async operation that gets queued up will stop/start the bundle according to the levels that got set during the whole framework start-level change processing. |
@tjwatson I agree. The behavior is ok, there should just not be an error reported in this case. |
@karlpauls @cziegeler
Any thoughts? |
…le start level < framework start level
I've updated the PR according to my proposal above. Feedback welcome. |
@tjwatson @karlpauls @cziegeler Would it be possible to take this PR? The log error message is not warranted here imho. In very large system, when this happens, it creates an avalanche of error logs. Would be very much appreciated if this could be in the next release. |
@karlpauls or @cziegeler should review the framework code. |
Any idea how to motivate them? :-) I could offer a beer but my (beloved) travel restrictions keep me out of their hoods ... |
I'll try to stay away from touching the framework code and leave it up to @karlpauls . I'm sure he'll have a look as soon as he has time |
We found problems when manipulating start levels from a bundle activator.
This test case can reproduce that, see console logs.
We can also extend that to check on results adding some assertions