Skip to content

The WebHook `recent_failures` counter may overflow

We recently had an incident on GitLab.com where we encounter an error 32768 is out of range for ActiveModel::Type::Integer with limit 2 bytes emanating from WebHookWorkers –see https://gitlab.com/gitlab-com/gl-infra/production/-/issues/4589 (internal)–. The stacktrace pointed at the WebHookService doing hook.update!(recent_failures: hook.recent_failures + 1) in an unconstrained way. We should change this so we don't risk an overflow in case of excessive failures.