Prevent web_hooks.recent_failures overflowing
What does this MR do and why?
Prior to this change, the recent_failures column would overflow if
incremented repeatedly within WebHook#backoff!
- this change clamps
the value on all updates to this column.
See: #378081 (closed)
How to set up and validate locally
- Enable the web-hooks-disable-failed flag:
Feature.enable(:web_hooks_disable_failed)
- Edit a web-hook model to have the maximum number of recent failures, as well as a defined
disabled_until
(the timestamp can be in the past):hook = WebHook.find(X) hook.update!(recent_failures: 32767, disabled_until: 1.hour.ago)
- In the console try to backoff the hook:
hook.backoff!
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Alex Kalderimis