- Notifications
You must be signed in to change notification settings - Fork 25.6k
Add slf4j-nop in order to prevent startup warnings #95459
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
Conversation
| Pinging @elastic/es-core-infra (Team:Core/Infra) |
| dependencies { | ||
| api project(":libs:elasticsearch-ssl-config") | ||
| | ||
| api "org.slf4j:slf4j-nop:2.0.6" // netty is using slf4j-api. |
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.
netty is using slf4j-api as an optional dependency. That dependency is being 'injected' via xpack-security dependency (how??)
stacktrace when slf4j is being used
bind:178, LoggerFactory (org.slf4j) performInitialization:170, LoggerFactory (org.slf4j) getProvider:455, LoggerFactory (org.slf4j) getILoggerFactory:441, LoggerFactory (org.slf4j) <init>:42, Slf4JLoggerFactory (io.netty.util.internal.logging) <clinit>:63, Slf4JLoggerFactory$NopInstanceHolder (io.netty.util.internal.logging) getInstanceWithNopCheck:59, Slf4JLoggerFactory (io.netty.util.internal.logging) useSlf4JLoggerFactory:62, InternalLoggerFactory (io.netty.util.internal.logging) newDefaultFactory:42, InternalLoggerFactory (io.netty.util.internal.logging) getDefaultFactory:111, InternalLoggerFactory (io.netty.util.internal.logging) getInstance:134, InternalLoggerFactory (io.netty.util.internal.logging) getInstance:127, InternalLoggerFactory (io.netty.util.internal.logging) <clinit>:81, PlatformDependent (io.netty.util.internal) <init>:34, ConstantPool (io.netty.util) <init>:36, ChannelOption$1 (io.netty.channel) <clinit>:36, ChannelOption (io.netty.channel) <clinit>:92, Netty4Transport (org.elasticsearch.transport.netty4) lambda$getTransports$27:1571, Security (org.elasticsearch.xpack.security) get:-1, Security$$Lambda$4841/0x0000000801c14b08 (org.elasticsearch.xpack.security) <init>:815, Node (org.elasticsearch.node) <init>:327, Node (org.elasticsearch.node) <init>:216, Elasticsearch$2 (org.elasticsearch.bootstrap) initPhase3:216, Elasticsearch (org.elasticsearch.bootstrap) main:67, Elasticsearch (org.elasticsearch.bootstrap) 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.
That dependency is being 'injected' via xpack-security dependency (how??)
if this is the case then x-pack-securitys api "org.apache.logging.log4j:log4j-slf4j-impl:${versions.log4j}" dependency can also influence other modules? Like ingest-attachmenet which is explicitly trying not to use it
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.
x-pack-security actually contains a second copy of transport-netty4, which it builds the security http/s implementations on top of. Although transport-netty4 still exists as a module, it is never loaded because x-pack-security overrides the transport implementation settings. So the version of transport-netty4 that needs fixing is just that in x-pack-security, where the nop dep can be a runtime dependency.
| Hi @pgomulka, I've created a changelog YAML for you. |
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.
LGTM
currently when Elasticsearch starts up there are warnings on the console
this is emitted twice
1 - when repository-azure module is loaded
2 - when transport-netty-4 module is loaded (transitively via xpack-security)
This commits adds a slf4j-nop to fix that warning
however this is unclear to my why they started in the first place.
might be related to #93714
and #93878