-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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-66139] Avoid polluting the log if usage stats cannot be sent #5621
Conversation
@@ -190,8 +196,10 @@ public String getStatData() throws IOException { | |||
} | |||
|
|||
return new String(Base64.getEncoder().encode(baos.toByteArray())); | |||
} catch (GeneralSecurityException e) { | |||
throw new Error(e); // impossible |
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.
impossible
😕❓
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 is a 13yrs old line of code, coming from the subversion and the details on the commit is limited.
I'm not sure if the exception was not possible or if the instance was supposed to survive past a GeneralSecurityException
.
How would you want this to be handled?
Co-authored-by: James Nord <jtnord@users.noreply.github.com>
Co-authored-by: James Nord <jtnord@users.noreply.github.com>
This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback. Thanks! |
…jenkinsci#5621) * [JENKINS-66139] Avoid polluting the log if usage stats cannot be sent * Update core/src/main/java/hudson/model/UsageStatistics.java Co-authored-by: James Nord <jtnord@users.noreply.github.com> * Update core/src/main/java/hudson/model/UsageStatistics.java Co-authored-by: James Nord <jtnord@users.noreply.github.com> * Update core/src/main/java/hudson/model/UsageStatistics.java Co-authored-by: James Nord <jtnord@users.noreply.github.com> (cherry picked from commit 1f1eb71)
…jenkinsci#5621) * [JENKINS-66139] Avoid polluting the log if usage stats cannot be sent * Update core/src/main/java/hudson/model/UsageStatistics.java Co-authored-by: James Nord <jtnord@users.noreply.github.com> * Update core/src/main/java/hudson/model/UsageStatistics.java Co-authored-by: James Nord <jtnord@users.noreply.github.com> * Update core/src/main/java/hudson/model/UsageStatistics.java Co-authored-by: James Nord <jtnord@users.noreply.github.com>
See JENKINS-66139.
Avoid polluting the log when the usage statistics can't be sent. The full stack trace is printed as FINE. The message is printed as INFO because the instance is not compromised, so it's better to avoid disturbing the administrators.
Simple change, no test added. Manually tested:
Usual execution failing to send stats:
Execution setting the FINE level to the UsageStatistics logger:
Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
Proposed changelog entries
section only if there are breaking changes or other changes which may require extra steps from users during the upgradeDesired reviewers
@mention
Maintainer checklist
Before the changes are marked as
ready-for-merge
:Proposed changelog entries
are correctupgrade-guide-needed
label is set and there is aProposed upgrade guidelines
section in the PR title. (example)lts-candidate
to be considered (see query).