-
Notifications
You must be signed in to change notification settings - Fork 661
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
SOLR-16976: Remove log4j-jul jar and use slf4j bridge for JUL #2703
Conversation
I don't have much knowledge in how logging works. One thing that would help, would you mind creating a BATS style test that demonstrates the bug and the fix? I believe you could write a test that starts up solr with remote JMX, and then we see the bug, and then the fix. The bats tests are in |
6ff4556
to
1e1e477
Compare
1e1e477
to
6512164
Compare
I've removed the patch and added a test to start solr with remote JMX enabled. It should fail with the exception seen in the Jira. |
Humm... I ran the "Solr Script Tests" expecting it to fail... I can run it locally tomorrow and see what I see! |
Ah my mistake, Solr starts even though the exception is logged. Added a refute_output for the exception. |
okay, the refute wasn't actually matching.. i found that we need to consult the log file. Also, I was getting a RMI Port exception.. Can you validate that this test fails for you, and hten add in your patch? |
Okay, so, after putting in the slf4j bridge, I see that the bats tests is now failing (and thats a good thing) because it means we don't see the error:
@szhou1998 would you mind flipping the |
2993c1c
to
3ba7b29
Compare
solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
Outdated
Show resolved
Hide resolved
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.
There's probably a .sha1 and maybe more to remove from the licenses/ dir.
Related to my comment on the JIRA issue, might you propose a short summary for CHANGES.txt? Like... this is maybe a bug or improvement; seems more like the latter but I defer to your judgement. We removed a dependency we didn't need (yay). We initialized JUL logging and thus... ?
Also looking for how to refer to you for attribution.
solr assert --started http://localhost:${SOLR_PORT} --timeout 5000 | ||
|
||
run cat ${SOLR_LOGS_DIR}/solr-${SOLR_PORT}-console.log | ||
refute_output --partial 'java.lang.ClassNotFoundException: org.apache.logging.log4j.jul.LogManager' |
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.
Lets generalize this to simply "Exception" -- we don't want any exceptions printed for whatever reason (JUL or otherwise).
ea8abe5
to
9e5c316
Compare
Please stop force-pushing to PRs -- it resets the review state in GitHub. |
# Conflicts: # solr/CHANGES.txt
Remove log4j-jul jar and use slf4j bridge for JUL to prevent exception from being logged when remote JMX is enabled . Updated jetty.xml to initialize the bridge super early. Co-authored-by: Eric Pugh <[email protected]> Co-authored-by: David Smiley <[email protected]> (cherry picked from commit dbf1c50)
https://issues.apache.org/jira/browse/SOLR-16976
Description
#1765 introduced a change that causes an exception when remote JMX is enabled (stack trace included in Jira description).
Solution
@elyograg provided a patch which resolves this issue by removing log4j-jul and using the slf4j bridge for JUL. I removed the NOCOMMIT from the patch.
Tests
@elyograg tested the patch. Added a test that there's no exception on Solr startup with remote JMX enabled.
Checklist
Please review the following and check all that apply:
main
branch../gradlew check
.