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

[JENKINS-73616] Log spam from AnnotationParser#parseClass #409

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

basil
Copy link
Member

@basil basil commented Aug 28, 2024

Context

See JENKINS-73616.

Problem

Users have complained that there are new warnings emitted on Jenkins startup.

Evaluation

These duplicates are known to the project and ignored in https://github.com/jenkinsci/jenkins/blob/c5c69abd2d346a694c29b3e5f5d3991d94c38556/test/src/test/java/jenkins/ClassPathTest.java because we cannot upgrade jansi without also upgrading Groovy as described in jenkinsci/jenkins#5184 (review) (though I doubt anyone has actually tried?).

Solution

Since these warnings are a false positive, turn up the log level for this class from the default level to SEVERE so that this log statement is not printed.

Testing done

Reproduced the issue with java -jar jenkins.war and could no longer reproduce after this PR.

@basil basil added the bug label Aug 28, 2024
@basil basil requested a review from MarkEWaite August 28, 2024 19:54
Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

Thanks very much!

I had tried something very close to this (using literal string as argument to getLogger instead of import) and had seen the LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE spotbugs warning yet when I ran with my changes, it did not suppress the log messages . Today, I did the same thing today and it works. Your technique with the import is much better, since it assures that the class is available at compile time. I must have been missing something yesterday when I was experimenting, but I don't know what it was.

I ran without your changes and I see the log messages. I ran with your changes and the log messages are not displayed Thanks very much!

@MarkEWaite MarkEWaite merged commit dd57eb2 into jenkinsci:master Aug 28, 2024
14 checks passed
@basil basil deleted the JENKINS-73616 branch August 28, 2024 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants