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

File handle leak when applying configuration as code file

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:
      Jenkins 1.164.1
      Configuration as Code Plugin 1.23
      Java 1.8.0_181
    • Similar Issues:

      Description

      I've encountered a file handle leak on the configuration yaml file whenever the configuration file is applied.

      This happens whenever you apply the configuration (through the UI or through groovy).

      We have a groovy script that calls the plugin directly to apply the configuration every 15 minutes, so that we can keep the CasC settings in source control to apply to our Jenkins servers periodically. We've noticed that the server will eventually run out of file handles and tracked it down to the CasC configuration file. The file handle leak makes this unusable.

       
       

      def casc = new GroovyClassLoader(context.class.getClassLoader()).loadClass("io.jenkins.plugins.casc.ConfigurationAsCode")
      def configFile = new File(configPath)
      if (casc && configFile.exists()) {
           context.echo("Now loading config file: ${configFile.absolutePath}")
           casc.get().configure(configFile.absolutePath)        
      }

       
       

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              ewel Ewelina Wilkosz
              Reporter:
              michaelw Michael Wong
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: