Skip to content

Prevent web_hooks.recent_failures overflowing

Alex Kalderimis requested to merge ajk-378081-recent_failures_overflow into master

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

  1. Enable the web-hooks-disable-failed flag:
    Feature.enable(:web_hooks_disable_failed)
  2. 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)
  3. 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.

Edited by Alex Kalderimis

Merge request reports