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

An agent log record with numeric params could be unformattable on the master #4621

Merged
merged 1 commit into from
Apr 11, 2020

Conversation

jglick
Copy link
Member

@jglick jglick commented Apr 3, 2020

Noticed in a support bundle an agent log (nodes/slave/…/jenkins.log) with

…	WARNING	h.r.RemoteInvocationHandler$Unexporter#reportStats: The 15 minute average rate is {0,number,0.0}±{1,number,0.0}/sec. At the 95% confidence level this is above 100.0/sec. If this message is repeated often in the logs then very seriously consider setting system property ''hudson.remoting.RemoteInvocationHandler.Unexporter.retainOrigin'' to ''false'' to trade debug diagnostics for reduced memory pressure.

This is from https://github.com/jenkinsci/remoting/blob/a09a8dd40e3269f578a503cee26b859e522ea6e2/src/main/java/hudson/remoting/RemoteInvocationHandler.java#L734-L745 but note the missing actual numbers (and '' where ' was meant). The reason is because of https://github.com/openjdk/jdk/blob/6bab0f539fba8fb441697846347597b4a0ade428/src/java.logging/share/classes/java/util/logging/LogRecord.java#L561-L565 plus https://github.com/openjdk/jdk/blob/6bab0f539fba8fb441697846347597b4a0ade428/src/java.logging/share/classes/java/util/logging/Formatter.java#L146-L148.

We could format every log record with parameters, which would be useful for code in the agent JVM doing something like

LOGGER.log(Level.INFO, "ran at {0} producing {1}", new Object[] {new Date(), someMutableObject});

but I went for the more conservative fix here.

Proposed changelog entries

  • Ensure that log messages are not missing numeric parameters when log entries are created on an agent. In particular, fix logs collected by the Support Core plugin

Maintainer checklist

Before the changes are marked as ready-for-merge:

  • There are at least 2 approvals for the pull request and no outstanding requests for change
  • Conversations in the pull request are over OR it is explicit that a reviewer does not block the change
  • Changelog entries in the PR title and/or Proposed changelog entries are correct
  • Proper changelog labels are set so that the changelog can be generated automatically
  • If the change needs additional upgrade steps from users, upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the PR title. (example)
  • If it would make sense to backport the change to LTS, a JIRA issue should exist and be labeled as lts-candidate

@jglick jglick added the bug For changelog: Minor bug. Will be listed after features label Apr 3, 2020
@jglick jglick added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Apr 6, 2020
Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

Looks good, will proceed with merge taking other approvals.
Please create a Jira issue if you want to get it backported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For changelog: Minor bug. Will be listed after features ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants