Repository navigation
Don't list KAR files that are still being extracted - #3164
Draft
holgerfriedrich wants to merge 1 commit into
Draft
holgerfriedrich wants to merge 1 commit into
holgerfriedrich wants to merge 1 commit into
Conversation
KarServiceImpl.list() returned every directory in the KAR storage. Kar.extract() creates that directory before unpacking, so a KAR was reported as installed while it was still being extracted. Callers acting on list() could then fail to resolve artifacts from the KAR repository, and KarArtifactInstaller skipped a KAR whose extraction had been interrupted, so it was never completed. Only list directories containing features.cfg, which install() writes once the extraction is complete.
Test Results1 132 files ±0 1 132 suites ±0 1h 29m 23s ⏱️ - 1h 57m 35s Results for commit 70c82cb. ± Comparison against base commit dcc0ea4. This pull request removes 2 tests. |
Contributor
Author
|
Reported in openhab/openhab-distro#2007. Reproduced with openHAB on Karaf 4.4.11 and 4.5.0 by creating the KAR directory before startup, which is the state during extraction or after an interrupted install. Feature installation failed with |
jbonofre
self-requested a review
November 26, 2026 15:17
lolodomo
pushed a commit
to lolodomo/openhab-core
that referenced
this pull request
Nov 28, 2026
Karaf lists a KAR as installed as soon as its extraction starts, and skips it on every following start. If openHAB is stopped while the KAR is extracted, features.cfg is never written and FeatureInstaller would wait for it forever. Track the size of the KAR directory. If a listed KAR without features.cfg does not change for 4 consecutive checks, install it again once. Afterwards it counts as installed even if that failed, so the add-on installation is never blocked. This can be removed once Karaf contains apache/karaf#3164. Signed-off-by: Holger Friedrich <mail@holger-friedrich.de> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
KarServiceImpl.list() returned every directory in the KAR storage. Kar.extract() creates that directory before unpacking, so a KAR was reported as installed while it was still being extracted. Callers acting on list() could then fail to resolve artifacts from the KAR repository, and KarArtifactInstaller skipped a KAR whose extraction had been interrupted, so it was never completed.
Only list directories containing features.cfg, which install() writes once the extraction is complete.