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

Jenkins 'Build with Parameters' Page Slows Over Time with active-choices-plugin (Resolves on Restart)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • active-choices-plugin

      I am experiencing increasing slowness on the "Build with Parameters" page for Jenkins jobs that use the UnoChoice plugin. The page initially loads quickly after a Jenkins restart, but progressively becomes slower over time (especially after a few days). Restarting Jenkins immediately resolves the slowness, but the degradation pattern repeats. I am are currently restarting jenkins twice per day to mitigate this. 

      Cascading setup example

      In my job configuration, I have a cascading effect involving three parameters:

      1. A Choice Parameter named region, with static values (e.g., us-west, us-east, eu-central).
      1. An Active Choices Reactive Parameter named environment, which depends on region.
      1. Another Active Choices Reactive Parameter named service, which depends on both region and environment.

      Here’s a simplified version of the parameter scripts:

      Choice Parameter – region

      • Type: Choice Parameter
      • Values:
         
        us-west 
        us-east 
        eu-central 

      Active Choices Reactive Parameter – environment

      • Groovy Script:
         
        if (region == "us-west") { 
            return ["dev", "staging", "prod"] 
        } else if (region == "eu-central") { 
            return ["dev", "prod"] 
        } else { 
            return ["dev"] 
        }

         

      Active Choices Reactive Parameter – service

      • Groovy Script:
        def url = "https://placeholder-url.com/api?region=${region}&env=${environment}"
        try {
            def conn = new URL(url).openConnection()
            conn.setConnectTimeout(3000)
            conn.setReadTimeout(3000)
            def result = conn.getInputStream().getText().trim()
            return result ? result.tokenize(',') : ["No Result Found"]
        } catch (Exception e) {
            return ["Error Fetching Results"]
        }

      Fallback script for service:

      return []

      Steps to Reproduce

      1. Create a freestyle or pipeline job with UnoChoice dynamic parameters.
      1. Configure parameter region as a static Choice Parameter.
      1. Configure environment as an Active Choices Reactive Parameter that depends on region.
      1. Configure service as another Active Choices Reactive Parameter that depends on both region and environment, with a Groovy script (e.g., querying external APIs or computing dropdowns).
      1. Observe the load time of the "Build with Parameters" page immediately after a Jenkins restart.
      1. Leave Jenkins running for several hours/days.
      1. Revisit the same page and observe the increasing load time.

      Expected Behavior

      The parameter page should be consistent regardless of instance uptime.

      Observed Behavior

      • Load time for the parameter page increases over time. For instance:
      • After restart: ~1 second
      • After 4 hours: ~5 seconds
      • After 12 hours : ~20+ seconds
      • Restarting Jenkins resets the performance.
      • The bigger the instance is in terms of job count and disk size, the more the parameter rendering slows down in correlation with uptime. 

            kinow Bruno P. Kinoshita
            medbellakhal Mohamed
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: