Deadlock found when trying to get lock response with 422 http status code

Hi,

On 30/09/2021, during one of our tests, we have created several child accounts, around ~130 within 3 minutes, under the same master account. Unfortunately, for more than half of them we got this kind of error response from NewRelic:

Invalid status code for targetUri=https://rpm.newrelic.com/api/v2/partners/1700/accounts/3269262/sub_accounts. Received 422 with response={“error”:“Error occurred: Mysql2::Error: Deadlock found when trying to get lock; try restarting transaction: /application=‘rpm-ui’ transaction=‘api/v2/sub_accounts/create’ location=‘sub_accounts#create’/ UPDATE accounts SET updated_at = ‘2021-09-30 14:16:36’, config_timestamp = ‘2021-09-30 14:16:36’ WHERE accounts.id = 3269262”}

Could you, please, detail what happened and, the most important, if there is any limit regarding how many sub-accounts can be created in a short period of time?

I have to mention, that we have retries in place for these situations, but this didn’t solve the issue.
Let me know if you do need more details about this issue.

Thank you,
CM

@cmota I’m going to route your questions to our support account team. They will be in contact soon via email. Thanks!