Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-73984

LaunchLogsFileContent may cause OOM on large logs files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • support-core-plugin
    • None
    • support-core:2.81
    • support-core:1519.vb_f214b_a_25a_a_5

      After seeing OOM ina. controller, the following was observed:

      java.lang.OutOfMemoryError: Java heap space
      	at java.base/java.util.Arrays.copyOf(Arrays.java:3537)
      	at java.base/java.lang.String.encodeUTF8(String.java:1267)
      	at java.base/java.lang.String.encode(String.java:835)
      	at java.base/java.lang.String.getBytes(String.java:1788)
      	at PluginClassLoader for support-core//com.cloudbees.jenkins.support.api.LaunchLogsFileContent.getInputStream(LaunchLogsFileContent.java:31)
      	at PluginClassLoader for support-core//com.cloudbees.jenkins.support.api.FileContent.lambda$createBaseFileContent$0(FileContent.java:102)
      	at PluginClassLoader for support-core//com.cloudbees.jenkins.support.api.FileContent$$Lambda$3010/0x00007b12991cd880.get(Unknown Source)
      	at PluginClassLoader for support-core//com.cloudbees.jenkins.support.api.BaseFileContent.writeTo(BaseFileContent.java:102)
      	at PluginClassLoader for support-core//com.cloudbees.jenkins.support.api.BaseFileContent.writeTo(BaseFileContent.java:128)
      	at PluginClassLoader for support-core//com.cloudbees.jenkins.support.api.FileContent.writeTo(FileContent.java:78)
      	at PluginClassLoader for support-core//com.cloudbees.jenkins.support.SupportPlugin.writeBundle(SupportPlugin.java:419)
      	at PluginClassLoader for support-core//com.cloudbees.jenkins.support.SupportPlugin.writeBundle(SupportPlugin.java:355)
      	at PluginClassLoader for support-core//com.cloudbees.jenkins.support.SupportPlugin$PeriodicWorkImpl.lambda$doRun$0(SupportPlugin.java:982)
      	at PluginClassLoader for support-core//com.cloudbees.jenkins.support.SupportPlugin$PeriodicWorkImpl$$Lambda$3177/0x00007b12997dc698.run(Unknown Source)
      	at java.base/java.lang.Thread.run(Thread.java:840)"
      

      The LaunchLogsFileContent is working on the whole file lines (for password redaction): https://github.com/jenkinsci/support-core-plugin/blob/1511.v3f5cc9b_a_ff55/src/main/java/com/cloudbees/jenkins/support/api/LaunchLogsFileContent.java#L26-L33. This can be a problem if the launch logs are large (which was observed due to repeated connection errors of an agent in an impacted environment).

            basil Basil Crow
            allan_burdajewicz Allan BURDAJEWICZ
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: