Skip to content
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

Fix initial suggestion finder installation #4206

Merged
merged 1 commit into from
May 2, 2024

Conversation

mherwege
Copy link
Contributor

@mherwege mherwege commented May 2, 2024

#4188 caused finders not to be installed anymore by default.
This PR should fix the issue.

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
@mherwege mherwege requested a review from a team as a code owner May 2, 2024 07:21
@mherwege
Copy link
Contributor Author

mherwege commented May 2, 2024

@J-N-K could you have a look at this? It fixes a regression of #4188 causing add-on finders not to be installed by default.

Copy link
Member

@J-N-K J-N-K left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@J-N-K J-N-K added bug An unexpected problem or unintended behavior of the Core regression labels May 2, 2024
@J-N-K J-N-K added this to the 4.2 milestone May 2, 2024
@J-N-K J-N-K merged commit 1a89b9e into openhab:main May 2, 2024
5 checks passed
@mherwege mherwege deleted the feature_install_fix branch May 2, 2024 16:05
@jlaur
Copy link
Contributor

jlaur commented May 2, 2024

@mherwege - continuing from #4036 (comment), it seems more appropriate to move the conversation here, unless there still something to be fixed - in that case I can create an issue?

I saw this comment:

// Changes to the configuration are expected to call the {@link modified} method. This works well when running
// in Eclipse. Running in Karaf, the method was not consistently called. Therefore regularly check for changes
// in configuration.
// This pattern and code was re-used from {@link org.openhab.core.karaf.internal.FeatureInstaller}
scheduler = ThreadPoolManager.getScheduledPool(ThreadPoolManager.THREAD_POOL_NAME_COMMON);
cfgRefreshTask = scheduler.scheduleWithFixedDelay(this::syncConfiguration, 1, 1, TimeUnit.MINUTES);

I don't know anything about it, but was wondering if this is still needed after #4188?

@mherwege
Copy link
Contributor Author

mherwege commented May 2, 2024

@jlaur Can you check if the addon finders are loaded (bundle:list)? There could be a delay, but if they are not there after a while there still is an issue.
When I tested this morning, they were not loaded, and it was because the service, at activation, was not calling the modified method anymore that should trigger the install if the finder is enabled. Once the finder is installed, it should register back with the service.
Before adding this call to modified back in in this PR, I tested by switching off (save) and on (save) the UPnP finder through the UI settings. Shortly after, I got UPnP discovery results. You could try with mDNS, as this typically gives results in most networks.

@jlaur
Copy link
Contributor

jlaur commented May 2, 2024

@jlaur Can you check if the addon finders are loaded (bundle:list)? There could be a delay, but if they are not there after a while there still is an issue.

I see only this:

openhab> bundle:list -s | grep addon
158 │ Active │  80 │ 4.2.0.202405020306    │ org.openhab.core.addon
159 │ Active │  80 │ 4.2.0.202405020313    │ org.openhab.core.addon.marketplace
160 │ Active │  80 │ 4.2.0.202405020314    │ org.openhab.core.addon.marketplace.karaf
171 │ Active │  80 │ 4.2.0.202405021809    │ org.openhab.core.config.discovery.addon
172 │ Active │  80 │ 4.2.0.202405020309    │ org.openhab.core.config.discovery.addon.process

Now, trying to access add-on settings http://localhost:8080/settings/services/org.openhab.addons seems to hang forever, so something is really messed up now.

I see this repeated in logs:

2024-05-02 22:05:38.926 [DEBUG] [ery.addon.process.ProcessAddonFinder] - bundle org.openhab.core.config.discovery.addon.process:4.2.0.202405020309 (172)[org.openhab.core.config.discovery.addon.process.ProcessAddonFinder(93)] : Querying state active
2024-05-02 22:06:47.599 [DEBUG] [scovery.addon.AddonSuggestionService] - bundle org.openhab.core.config.discovery.addon:4.2.0.202405021809 (171)[org.openhab.core.config.discovery.addon.AddonSuggestionService(106)] : Querying state active
2024-05-02 22:06:47.600 [DEBUG] [ery.addon.process.ProcessAddonFinder] - bundle org.openhab.core.config.discovery.addon.process:4.2.0.202405020309 (172)[org.openhab.core.config.discovery.addon.process.ProcessAddonFinder(93)] : Querying state active
2024-05-02 22:06:49.506 [DEBUG] [scovery.addon.AddonSuggestionService] - bundle org.openhab.core.config.discovery.addon:4.2.0.202405021809 (171)[org.openhab.core.config.discovery.addon.AddonSuggestionService(106)] : Querying state active

I'll try to go back to a previous snapshot to isolate the issue.

@jlaur
Copy link
Contributor

jlaur commented May 2, 2024

Snapshot 4046 seems to work fine.

@mherwege
Copy link
Contributor Author

mherwege commented May 2, 2024

Snapshot 4046 seems to work fine.

@jlaur That’s a relief. I found it is difficult to replace these bundles that directly use Karaf specific features in a version. That’s probably also what caused your issue.

@jlaur
Copy link
Contributor

jlaur commented May 2, 2024

That’s a relief. I found it is difficult to replace these bundles that directly use Karaf specific features in a version. That’s probably also what caused your issue.

Snapshot 4046 is from April 22nd, so before #4188 was merged. Unfortunately the most recent snapshots are still broken for me. Just to be sure, I will try tomorrow's snapshot to rule out any mistakes by replacing the single JAR.

@holgerfriedrich
Copy link
Member

Same for me, current main line does not work. Only process addon-finder is loaded and running.

@mherwege
Copy link
Contributor Author

mherwege commented May 3, 2024

I tried this morning with the latest snapshot, and there is indeed another error in the logic. I will create a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of the Core regression
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants