Agent executable screens can cause significant memory pressure when there are a lot of deployment environments

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Low
    • 9.0.0
    • Affects Version/s: 6.9.2, 8.0.4
    • Component/s: Agents
    • None
    • 5
    • Severity 2 - Major

      Issue Summary

      Agent executable screens can cause significant memory pressure when there are a lot of deployment environments:

      • $BAMBOO_BASE_URL/agent/viewAgentExecutableEnvironments.action: Viewable when viewing an agent through a non admin route. E.g. Deployment Environment >> Agent Assignment >> Can be deployed by x agents >> agent >> Executable deployment environments
      • $BAMBOO_BASE_URL/agent/admin/ajax/viewAgentExecutableDeployments.action: Bamboo Administration >> Agents >> (agent) >> Executable deployment environments

      Steps to Reproduce

      1. Create a large number of deployment environments, e.g. 2000 that can be deployed by a single agent
      2. Turn on GC logging (or watch memory usage with a Java profiler)
      3. Visit Bamboo Administration >> Agents >> (agent) >> Executable deployment environments
      4. Watch memory pressure increase in GC logging (or Java profiler)

      Expected Results

      Paginated results that don't load all deployment environment data into memory.

      Actual Results

      Memory pressure is unrealistic and can OOM an instance depending on amount of environments deployable by that agent.

      Workaround

      1. Block the URLs from user access at your load balancer or educate user base to avoid these menus.
      2. Reduce amount of deployment environments or increase total JVM heap to help mitigate OOM situations.
      3. Change Bamboo's templates to prevent users from trying to load up these menus:
        Workaround 3 – Instructions

        1. Stop Bamboo.

        /agent/admin/ajax/viewAgentExecutableDeployments.action

        2. Create a backup of the <bamboo-install>/atlassian-bamboo/admin/agent/viewAgent.ftl file.
        3. Remove the following line from the viewAgent.ftl file:

        viewAgent.ftl
        [@agt.executablesPaneContent action="viewAgentExecutableDeployments" selector="#Executabledeploymentenvironments" id=agentId/]
        

        This line shows up twice inside the file. Make sure to remove both of them.

        /agent/viewAgentExecutableEnvironments.action

        4. Create a backup of the <bamboo-install>/atlassian-bamboo/agent/viewAgentExecutableEnvironments.ftl file.
        5. Remove the following line from the viewAgentExecutableEnvironments.ftl file:

        viewAgentExecutableEnvironments.ftl
        [@agt.executableEnvironments environmentList=executableEnvironments /]
        

        6. Start Bamboo.

        The tabs will still be there inside the agent summary page after restarting Bamboo but they will show up empty if users click on them – Bamboo will no longer try to load the list of deployment environments that agents are capable of running. This means Bamboo should no longer run out of memory if anyone attempts to click on these menus.

        It's important to remember that changes made to templates won't survive an upgrade. Therefore you'd need to make the same changes again after upgrading Bamboo – unless, of course, you are upgrading to a version of Bamboo where this bug has been fixed i.e. Bamboo 9.0.0 and higher.

            Assignee:
            Krzysztof Podsiadło
            Reporter:
            Jeremy Owen
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: