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

File handle leak when applying configuration as code file


    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • Jenkins 1.164.1
      Configuration as Code Plugin 1.23
      Java 1.8.0_181

      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}")


            ewel Ewelina Wilkosz
            michaelw Michael Wong
            0 Vote for this issue
            1 Start watching this issue