-
-
Notifications
You must be signed in to change notification settings - Fork 428
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
Simplify core features to prevent unnecessary bundle refreshes #1709
Conversation
It seems that when multiple features install the same bundle it may cause Karaf to refresh bundles when (un)installing features. When the (redundant) openhab-core-automation feature is removed and the serial dependencies are merged into the openhab-transport-serial feature these restarts due these bundle refreshes no longer occur. Fixes openhab#1322, openhab#1354 Signed-off-by: Wouter Born <[email protected]>
Note that it might still occasionally refresh bundles during (un)installs. That is normal behavior in an OSGi environment when a bundle has an optional dependency which is installed and previously was not (and vice versa). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds awesome @wborn!
Are you sure that these are the only problematic features and problem is thus solved for all our add-ons?
Do I understand it correctly that Karaf (as some precaution?) refreshes bundles in dependent features of any newly installed feature? Is there a strong reason why Karaf does that (instead of leaving the decision to the underlying OSGi framework) and can that maybe be deactivated?
Related to openhab/openhab-core#1709 Signed-off-by: Wouter Born <[email protected]>
Related to openhab/openhab-core#1709 Signed-off-by: Wouter Born <[email protected]>
Related to openhab/openhab-core#1709 Signed-off-by: Wouter Born <[email protected]>
Related to openhab/openhab-core#1709 Signed-off-by: Wouter Born <[email protected]>
I tested installing and uninstalling several add-on features and with these changes the unnecessary refreshes were resolved. If there are more such issues we might fix them similarly.
The exact reasons why Karaf starts refreshing bundles that are defined in multiple features is not clear to me. Perhaps it is a bug and it gets confused somehow. Maybe @jbonofre knows the reason and if this is a known (and fixed) Karaf issue? I couldn't find a fix for this in newer 4.2.x releases. We currently use Karaf 4.2.7. |
Related to openhab/openhab-core#1709 Signed-off-by: Wouter Born <[email protected]>
…ab#1709) It seems that when multiple features install the same bundle it may cause Karaf to refresh bundles when (un)installing features. When the (redundant) openhab-core-automation feature is removed and the serial dependencies are merged into the openhab-transport-serial feature these restarts due these bundle refreshes no longer occur. Fixes openhab#1322, openhab#1354 Signed-off-by: Wouter Born <[email protected]> GitOrigin-RevId: 76f5102
It seems that when multiple features install the same bundle it may cause Karaf to refresh bundles when (un)installing features.
I found the bundles which cause these refreshes by (un)installing features with the verbose (-v) option so Karaf shows what happens:
In this case it restarted the whole RuleEngine and also the Network Binding because it refreshed the
org.openhab.core.automation
bundle.Refreshes of the
org.openhab.core.io.transport.serial
bundle also seems to cause these restarts:When the (redundant) openhab-core-automation feature is removed and the serial dependencies are merged into the openhab-transport-serial feature these restarts due these bundle refreshes no longer occur.
Fixes #1322
Fixes #1354