Performance problems with Pull requests
Asked by Matthias Fasching:

Hi community,

For \~ 2 weeks now merging PRs in any of our repositories takes minutes instead of seconds, even if the PR only consists of one small commit.

Furthermore larger PRs just fail to render with the message: "Something went wrong. Wait a few moments, then try again. If this keeps happening, let us know at [support.atlassian.com](https://support.atlassian.com/)."

Is there anything we can do to resolve these issues?


Answers:
author: Theodora Boudale
body: Hi Matthias and welcome to the community.

Our engineering teams are in the process of migrating many of our core services onto new infrastructure. As part of this migration, we are aware that certain operations including those that require significant file system I/O may perform more slowly than usual.

It is helpful to realize that pull request merges are an asynchronous operation. This means that after you click "Merge" this triggers work in the background to take care of merging the changes in your pull request into the destination branch. In fact, once you see the message "Merge in progress" on the page, you can safely navigate away. When you revisit the pull request a few minutes later, it will be merged.

While merges may take longer than normal over the next few days, rest assured they are still working! We will update our [status page](https://bitbucket.status.atlassian.com/) if our monitoring systems ever detect that merges are actually failing to complete successfully.

We are actively engaged in a number of optimizations that should alleviate these issues in the coming days. In the meantime, please bear with us!

Steps you can take on your end to improve the experience regarding PR diffs timing out include:

1. Try to keep the number of open pull requests in your repository to a minimum. Decline any old pull requests that you aren't likely to merge. (You can always open new ones later.)
2. Break large changes into multiple smaller pull requests. Not only will these load faster, they'll be more digestible and easier for your teammates to review!

Kind regards,  
Theodora

comments: author: Marek Kadek
body: \> When you revisit the pull request a few minutes later, it will be merged.

This is absolutely not the case. After several minutes it will just roll back to old state, pretending merge button was never hit. I just reproduced this 6x.

\> Break large changes into multiple smaller pull requests.

This happens even for one-liners of PR.


author: Theodora Boudale
body: Hi everyone,

I just wanted to let you know that we have a blog post published from our head of engineering for more context regarding the issues with PRs merges taking a long time and PR diffs loading slowly or timing out.

* <https://bitbucket.org/blog/encountering-some-turbulence-on-bitbuckets-journey-to-a-new-platform>

I am quoting here the summary from the blog post:
> Merging pull requests takes longer than it used to, but it is important to realize that merges happen asynchronously in the background and so you do not need to wait for a pull request to be merged. If you navigate away, it will finish while you are doing other things. We're updating the UX to make this clear.
>
> Rendering pull request diffs is currently slower and sometimes timing out, but we are actively working on fixing this and **expect the issue to be largely resolved for all customers very soon---within days, not weeks**.

Our dev team has deployed a fix that has resolved most of the issues with small PR diffs and is working on a fix that will address the rest.

I would also like to add a note here that we have the following limits for diffs in Bitbucket Cloud:

* <https://support.atlassian.com/bitbucket-cloud/docs/limits-for-viewing-content-and-diffs/>

[@Matthias Fasching](/t5/user/viewprofilepage/user-id/4460679) and [@Marek Kadek](/t5/user/viewprofilepage/user-id/4470083),

Are you still experiencing issues with PR diffs (that are within our diff limits) being slow or timing out?

If so, you can open a ticket with the support team as they may be able to help. I see you're both part of Bitbucket workspaces on a paid plan, so you should be able to open a support ticket via <https://support.atlassian.com/contact/#/>, in "What can we help you with" select "Technical issues and bugs" and then Bitbucket Cloud as product.

[@Marek Kadek](/t5/user/viewprofilepage/user-id/4470083) regarding PR merges, you mention
> This is absolutely not the case. After several minutes it will just roll back to old state, pretending merge button was never hit. I just reproduced this 6x.

I'm not sure I understand what you mean by "roll back to old state": do you see these PRs getting merged and then later go to 'OPEN' status again? Or are they not getting merged at all?

I would suggest either opening a new question in community about this so we can look into this specific issue, or reach out to the support team via <https://support.atlassian.com/contact/#/>.

Kind regards,  
Theodora


author: Matthias Fasching
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086)

thanks for the detailed reply. I don't think we had a PR in our repositories that exceeded the limits stated in the link you provided. The issue of not being able to render a PR also hasn't occurred again since I opened this discussion. Should it appear again I will give an update.

I think the issue [@Marek Kadek](/t5/user/viewprofilepage/user-id/4470083) has with merging PRs is similar to the one we are experiencing: There is no visual feedback that something is happening when we click on the merge button.

I noticed that PRs will get merged eventually after confirming them on the bitbucket website. The problem is that the PR in bitbucket doesn't indicate that something is happening in the background. So when I click merge and go back to the PR, it's like nothing has happened.

Regards,  
Matthias


author: Theodora Boudale
body: Hi [@Matthias Fasching](/t5/user/viewprofilepage/user-id/4460679),

Thank you for the update, it's good to hear that the issue with PR diffs is resolved for you now.

Regarding PR merges, after you select "Merge", there should be a message below the PR details that the merge is in progress, like in the screenshot below:

![Screenshot 2021-07-12 at 13.19.23.png](https://community.atlassian.com/t5/image/serverpage/image-id/151021i8BFF262D5FE1F955/image-size/large?v=v2&px=999 "Screenshot 2021-07-12 at 13.19.23.png")

Is this something that you're not seeing when you merge a PR?

Kind regards,  
Theodora


author: Matthias Fasching
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086)

is this feature new? I noticed it today, but I'm sure it wasn't there one or two weeks ago.

This already helps a lot, at least we now know that something is happening in the background :-)

Thanks,  
Matthias


author: Theodora Boudale
body: Hi [@Matthias Fasching](/t5/user/viewprofilepage/user-id/4460679),

Yes, I believe this was added a few days ago, it was previously shown as a dialog only to the user who was merging the PR, at the time the user clicked "Merge".

Good to hear that this is helpful!

Please feel free to let me know if you need anything further.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud