• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 6.13.18, 7.8.1
    • 5.10.7, 6.0.3, 7.4.3
    • Macros - Jira Macros

      Summary

      There is an excessive delay in loading the editor for a Confluence page that has several Jira Issue Macros (JIM) that are using the 'Total Issue Count' option in the 'Display Options'. This appears to be linked to Jira servers/clusters that have a million issues (or more).

      Environment

      Confluence 7.4.3.
      Jira 8.5.8 (maybe other versions of JIRA as well)

      Steps to Reproduce

      1. Install Jira 8.5.8 and Confluence 7.4.3 in test environment. I used PSQL db for the test.
      2. Populate the application data in JIRA to have 500k to 1 million issues. Confluence can be at default settings.
      3. Setup an application link between the two servers.
      4. In Confluence, create a new test page with 15 JIM macros each using JQL to filter the table and make sure that in the 'Display Options' in the macro, the 'Total Issue Count' option is selected. The filter should have a high amount of issues included (500k to 1 million) among several of the macros. Save the page.
      5. Notice it reaches out to JIRA to pull total issues for each macro.
      6. While on the test page, click the EDIT button (top right).

      Expected Results

      The editor should load in a reasonably quick time, or at least inline with how long it takes to query and retrieve the total issue values from Jira.

      Actual Results

      The editor takes 3x-5x the time it should to fully load before being available to edit the page.

      Notes

      • The delay comes from the editor reaching out to JIRA and requesting/loading the total issue counts after the EDIT button has been pressed. This is to include the total issue count for the macros in the editor.
      • While viewing a page, there are asynchronous REST calls to get the total issue count for the macros (this is behaving normally) which is several times faster than in edit mode.
      • Customers have observed that the delay in v6.15.9 is 50% less than in v7.4.3. for the editor with the same dataset in Jira.

      Workaround

      • Splitting page into smaller pages will help with page load.
      • Starting from versions 7.8.1 and 6.13.18, in the dark features, we would need to add "confluence.extra.jira.edit.ignore.count" to prevent Confluence from making requests to Jira. Due to that change, instead of a real count number, we will see "x" in edit mode.

            [CONFSERVER-44664] Can not edit a page with 42 JIRA Issue Macros

            Alex K added a comment -

            A fix for this issue is available to Server and Data Center customers in Confluence 7.8.1
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            Alex K added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 7.8.1 Upgrade now or check out the Release Notes to see what other issues are resolved.

            Ludo added a comment -

            Thank you very much dpabst for you help!

            I am leaving the original page for your testing purpose.

            Cheers!

            Ludo added a comment - Thank you very much dpabst for you help! I am leaving the original page for your testing purpose. Cheers!

            lquiroga just adding this here from our HipChat conversation for completeness

            [5:02 PM] Dee Pabst: you might have to change your page a little but i think a JIRA two dimensional chart might show some of what you need
            [5:02 PM] Ludovico Quiroga: yes
            [5:02 PM] Dee Pabst: have a look at my page - https://extranet.atlassian.com/display/~dpabst/JIRA+Chart+Test

            Dee (Inactive) added a comment - lquiroga just adding this here from our HipChat conversation for completeness [5:02 PM] Dee Pabst: you might have to change your page a little but i think a JIRA two dimensional chart might show some of what you need [5:02 PM] Ludovico Quiroga: yes [5:02 PM] Dee Pabst: have a look at my page - https://extranet.atlassian.com/display/~dpabst/JIRA+Chart+Test

            Ludo added a comment -

            Hi qpham@atlassian.com and dpabst, is there any workaround that I could use to be able to edit the page?

            Would remove the first JIM via the API and after that copy the page (without the JIM) to some other place work?

            Thank you very much for your help!

            Ludo added a comment - Hi qpham@atlassian.com and dpabst , is there any workaround that I could use to be able to edit the page? Would remove the first JIM via the API and after that copy the page (without the JIM) to some other place work? Thank you very much for your help!

            Quan Pham added a comment -

            Hi bmcnamara and dpabst.

            I found the root caused for this problem after doing some debug for rendering JIM on table header (not related to editing problem)
            JIM first init to processing placeholder by search all DOM nodes with contain place holder when page is loading and using it for processing later.
            Unfortunately, table header which contain these DOM node will be change after that, then DOM nodes will be not existing anymore and process for replace the placeholder will not work. So to make it work correctly, when the data return when calling ajax we have to search all placeholder again.

            Quan Pham added a comment - Hi bmcnamara and dpabst . I found the root caused for this problem after doing some debug for rendering JIM on table header (not related to editing problem) JIM first init to processing placeholder by search all DOM nodes with contain place holder when page is loading and using it for processing later. Unfortunately, table header which contain these DOM node will be change after that, then DOM nodes will be not existing anymore and process for replace the placeholder will not work. So to make it work correctly, when the data return when calling ajax we have to search all placeholder again.

            Hi qpham@atlassian.com, are you please able to help us understand what is going on here?

            Brendan McNamara added a comment - Hi qpham@atlassian.com , are you please able to help us understand what is going on here?

            On the transplant page I can recreate the JIM spinning forever in the header cell of a table problem.. but i can still edit the page.. weird.

            Dee (Inactive) added a comment - On the transplant page I can recreate the JIM spinning forever in the header cell of a table problem.. but i can still edit the page.. weird.

            I was able to transplant the JIM to another page : https://extranet.atlassian.com/pages/viewpage.action?pageId=2989230920 and it works fine.. so the next theory would be that the JIM is not happy with being in a table header row. but not sure.

            Dee (Inactive) added a comment - I was able to transplant the JIM to another page : https://extranet.atlassian.com/pages/viewpage.action?pageId=2989230920 and it works fine.. so the next theory would be that the JIM is not happy with being in a table header row. but not sure.

            the first JIRA Issues macro has the storage format:

            <ac:structured-macro ac:name=\"jira\" ac:schema-version=\"1\" ac:macro-id=\"50bf442a-573f-42d0-a162-65f50ca64100\"><ac:parameter ac:name=\"server\">Atlassian JIRA Extranet - Special Projects</ac:parameter><ac:parameter ac:name=\"jqlQuery\">(project = PUR AND issuetype in (&quot;Production Issue&quot;, &quot;Change Request&quot;, &quot;New Feature&quot;) AND created &gt; 2016-06-30 AND created &lt;= 2016-09-30 AND &quot;Purchasing Teams&quot; = &quot;Express Lane&quot;)  and status = Cancelled  </ac:parameter><ac:parameter ac:name=\"count\">true</ac:parameter><ac:parameter ac:name=\"serverId\">1202c5f7-2db8-3476-90b9-79417ee44946</ac:parameter></ac:structured-macro>
            

            Dee (Inactive) added a comment - the first JIRA Issues macro has the storage format: <ac:structured-macro ac:name=\ "jira\" ac:schema-version=\ "1\" ac:macro-id=\ "50bf442a-573f-42d0-a162-65f50ca64100\" ><ac:parameter ac:name=\ "server\" >Atlassian JIRA Extranet - Special Projects</ac:parameter><ac:parameter ac:name=\ "jqlQuery\" >(project = PUR AND issuetype in (&quot;Production Issue&quot;, &quot;Change Request&quot;, &quot;New Feature&quot;) AND created &gt; 2016-06-30 AND created &lt;= 2016-09-30 AND &quot;Purchasing Teams&quot; = &quot;Express Lane&quot;)  and status = Cancelled  </ac:parameter><ac:parameter ac:name=\ "count\" > true </ac:parameter><ac:parameter ac:name=\ "serverId\" >1202c5f7-2db8-3476-90b9-79417ee44946</ac:parameter></ac:structured-macro>

            Stuff I have tried:

            1. I noticed the first JIM on the page (in the header of the table) spins forever. I attempted to remove this via the rest api and succeeded, however the page would not allow edit.
            2. Using the rest api I copied the entire storage format to another page: https://extranet.atlassian.com/display/~dpabst/Express+Lane+-+Maintenance+issues it is also not editable
            3. logs in kibana show it timing out after 60 seconds: https://kibana.atlassian.io/app/kibana?#/discover?g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now%2Fd,mode:quick,to:now%2Fd))&_a=(columns:!(_source),index:'logs_eac_extranet-atlassian-com_prod*',interval:auto,query:(query_string:(analyze_wildcard:Unable to render embedded object: File ('logtype:application%20AND%202982618207')),sort:) not found.('@timestamp',desc)

            Dee (Inactive) added a comment - Stuff I have tried: I noticed the first JIM on the page (in the header of the table) spins forever. I attempted to remove this via the rest api and succeeded, however the page would not allow edit. Using the rest api I copied the entire storage format to another page: https://extranet.atlassian.com/display/~dpabst/Express+Lane+-+Maintenance+issues it is also not editable logs in kibana show it timing out after 60 seconds: https://kibana.atlassian.io/app/kibana?#/discover? g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now%2Fd,mode:quick,to:now%2Fd))&_a=(columns:!(_source),index:'logs_eac_extranet-atlassian-com_prod *',interval:auto,query:(query_string:(analyze_wildcard: Unable to render embedded object: File ('logtype:application%20AND%202982618207')),sort:) not found. ('@timestamp',desc)

              qpham@atlassian.com Quan Pham
              lquiroga Ludo
              Affected customers:
              2 This affects my team
              Watchers:
              15 Start watching this issue

                Created:
                Updated:
                Resolved: