-
Bug
-
Resolution: Fixed
-
Low
-
1
-
Severity 3 - Minor
-
0
-
Rendering of pages having many static connect macros (without caching) can cause a gateway timeout if the rendering takes longer than 60 seconds.
We ran into this when one of our customers exported a single page having a lot of multi-excerpt macros (those are static connect macros).
Calling the /contentbody/convert/export_view REST API apparently took longer than one minute so the gateway closed the connection.
This is a critical issue for us, because customers don't think of timeouts when adding (connect) macros on their pages.
Steps to reproduce:
- Install an addon providing a 'dummy' static content macro that sleeps three seconds (contact cli@atlassian.com for this)
- Insert 20 of the dummy macros into a Confluence page. Alternatively, POST the following JSON containing twenty of these macros to <your- site>/wiki/rest/api/contentbody/convert/export_view
{ "value" : "<p>before</p> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <ac:structured-macro ac:name=\"dummy\" ac:schema-version=\"1\" ac:macro-id=\"c9a41198-7f37-4009-842f-d263f02409d6\"/> <p>after</p>", "representation" : "storage" }
- You'll run into a '504 Gateway Time-out' after exactly one minute.
Investigation Results:
I think the problem is that currently the Confluence page waits for all macros on the page to send back a response before rendering all of them. Because of this, when one macro times out, the entire page cannot be rendered.
Solution:
Refer to Steven's comment.