Timeout when creating merge request with large body
Summary
When creating a merge request with a very large body, the request times out after 1 minute. I encountered this when Renovate Bot tried to create it's changelog body with the API. I thereafter tried to reproduce this in the UI and it failed with a timeout too.
Steps to reproduce
- Create a merge request
- paste this in the merge request body: https://controlc.com/b9dc8624
- Submit merge request
- Merge request creation fails with a timeout
What is the current bug behavior?
Merge request creation fails with a timeout (500 error)
What is the expected correct behavior?
Either create the merge request or reject the body payload due to it's size.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Potential root causes
I suspect that what's actually happening here is that we're failing to process the merge request body within the minute we allot to web requests - we take the markdown and process it into HTML synchronously, which takes more time with longer bodies. (#217483 (comment 344558907))
Possible fixes
Don't really know, but I do know you guys recently switched over the CDN to CloudFlare. The response suggests to me it's a CloudFlare and not an API server timeout per se.
https://docs.gitlab.com/ee/administration/instance_limits.html#size-of-comments-and-descriptions-of-issues-merge-requests-and-epics states that the limit is 1MB. My filesystem says the size of the text is 569,5 kB, so fairly large, but still within the limit stated in the docs.
You can find the relevant issue where I discuss this with Renovate author here: https://github.com/renovatebot/config-help/issues/650
Edit notes:
I tried to create the same merge request but with a generated random string with a length of 1000000c and Gitlab submitted that string just fine (~8 seconds to create MR). So seems like there is an issue with the markdown of the body payload referenced earlier.