Skip to content

Graceful degradation for refs endpoint

Vasilii Iakliushin requested to merge graceful_degradation_for_refs into master

What does this MR do and why?

Contributes to #351520 (closed)

Problem

We have an unhandled exception when Gitaly is not available.

Solution

Return 503 error with an error message.

Screenshots or screen recordings

Before After
Screenshot_2022-03-17_at_11.47.58 Screenshot_2022-03-17_at_11.48.43
Screenshot_2022-03-17_at_11.47.08 Screenshot_2022-03-17_at_11.39.32

Screenshot_2022-03-17_at_11.48.57

There is no UI difference, because we equally handle 500 and 503 errors. However, now API responds with a structured error message and a proper http error code.

How to set up and validate locally

  1. Visit http://127.0.0.1:3000/flightjs/Flight/refs
  2. Disable Gitaly (gdk stop gitaly)
  3. Visit http://127.0.0.1:3000/flightjs/Flight/refs
  4. Check that the response code is 503 and the response contains an error message.

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 Vasilii Iakliushin

Merge request reports

Loading