Repository navigation
OAK-12503 : support slf4j 1.7 and 2.0 #3259
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
Open
rishabhdaim
wants to merge
6
commits into
trunk
Choose a base branch
from
OAK-12503
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b19e609
OAK-12503 : support slf4j 1.7 and 2.0
rishabhdaim 6f59309
OAK-12503 : compile libraries against slf4j 1.7
rishabhdaim a629473
OAK-12503 : align slf4j test providers with the api
rishabhdaim 864e6eb
OAK-12503 : fix elastic slf4j spi compatibility
rishabhdaim f492b58
OAK-12503 : verify embedded logging on both slf4j runtimes
rishabhdaim 110fe7d
OAK-12503: verify embedded logging bridge compatibility
rishabhdaim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
239 changes: 238 additions & 1 deletion
239
oak-it-osgi/src/test/java/org/apache/jackrabbit/oak/osgi/OSGiIT.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
This increased import range I consider still wrong. The default one from Bnd is correct and SLF4J still exports package version 1.x.
Uh oh!
There was an error while loading. Please reload this page.
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.
I checked the generated manifests and ran the OSGi tests with and without the override.
With SLF4J 1.7.36, bnd 6.3.1 generates org.slf4j.spi;version="[1.7,2)" by default.
SLF4J 2.0.20 exports org.slf4j.spi only at version 2.0.20.
Its additional 1.7.36 compatibility exports cover org.slf4j and org.slf4j.helpers, but not org.slf4j.spi.
See SLF4J’s export configuration.
Without the override, bnd generates [1.7,2), which rejects SLF4J 2.0’s SPI package.
I reproduced the resulting LocationAwareLogger loading failure; restoring [1.7,3) made the tests pass.
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.
org.slf4j.spiis not backwards compatible, onlyorg.slf4j. Widening the import version range doesn't make it magically backwards compatible either. That the test don't run into issues probably just proofs that they are not complete. See discussion at qos-ch/slf4j#358 and https://jira.qos.ch/browse/SLF4J-579.Particularly pay attention to
Uh oh!
There was an error while loading. Please reload this page.
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.
Agreed that SLF4J does not guarantee compatibility for the entire SPI package; this exception preserves the embedded Commons Logging 1.3.5 bundle's own optional
[1.7,3)SPI import.In 110fe7d0c0, I clarified the POM comment and changed the test to use
LogFactory.getLogwith the real OSGi provider, checking enabled/disabled levels, throwable identity and caller location: all 9 OSGi tests pass on both SLF4J 1.7.36 / Logback 1.2.13 and SLF4J 2.0.20 / Logback 1.6.4, while removing the override reproduces twoLocationAwareLoggerloading errors.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.
Ok, so commons-logging itself has a widened import range there, no problem. The AWS SDK apparently only uses org.slf4j.event.Level without calling any 2.x-specific methods, so it will work de facto with the widened range (and apparently it used to work in Oak with 1.x in the past and 2.x now), so I guess we can do this. But I'd really prefer if we keep this temporary and go fully 2.x ASAP.
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.
@mbaedke, yes, the goal is that this is a temporary arrangement, and we would probably remove the support for 1.x in future releases.
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.
@kwin @mbaedke if the changes looks fine, can we go ahead and merge this PR now ?