Skip to content

Resolve "500 error when deleting group web hook due to statement timeout"

What does this MR do?

For #29215 (closed)

We already have foreign key with cascading deletes on web_hook_logs, so we can make use of this instead of dependent: :destroy to remove web_hook_logs records upon deleting a webhook.

This is currently leading to 500 errors as mentioned in #29215 (closed), because of large number of web_hook_logs records present for a webhook.

By moving away from dependent: :destroy we could solve this problem.

Testing:

I tested this out on my local by creating around ~300000 web_hook_log records via the console for a web_hook and then trying to delete it via the UI.

With dependent: :destroy enabled, the DESTROY request timed out (as mentioned in the issue)

Screenshot_2019-10-16_at_11.26.54_AM

After removing dependent: :destroy, the request completed successfully and the associated web_hook_logs records were also deleted.

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading