Add IP fallback errors to Gitlab::HTTP HTTP_ERRORS

What does this MR do and why?

  • Adds Errno::EADDRNOTAVAIL, Errno::EAFNOSUPPORT and Errno::ETIMEDOUT to Gitlab::HTTP_V2::HTTP_ERRORS (which Gitlab::HTTP::HTTP_ERRORS points to). These errors trigger the next-IP fallback added in !239733 (merged), but they were not in the list. When the last IP also failed, callers that rescue *Gitlab::HTTP::HTTP_ERRORS did not catch the error.
  • Webhooks: WebHookService did not rescue the error, so the failure was not logged in the hook's logs, the hook did not get the normal backoff or auto-disable, and Sidekiq retried the job.
  • CI include:remote: pipelines failed with a misleading "Unable to run pipeline - Undefined error".
  • Adds a spec for each fallback error, checking that Gitlab::HTTP_V2.try_get returns nil when every resolved IP fails with that error.

References

Expected side effects

How to set up and validate locally

  1. From gems/gitlab-http, run bundle exec rspec spec/gitlab/http_v2/ip_fallback_spec.rb.
  2. Optionally, revert the change in gems/gitlab-http/lib/gitlab/http_v2/exceptions.rb and rerun. The new examples for ETIMEDOUT, EADDRNOTAVAIL and EAFNOSUPPORT fail.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading
Loading