Commit b4445c7b authored by David Kim's avatar David Kim Committed by Mayra Cabrera

Allow projects to be displayed when Gitaly fails to load pipeline status

parent 8240d01a
---
title: Fix pipeline status loading errors on project dashboard page caused by Gitaly
connection failures
merge_request: 23378
author:
type: fixed
......@@ -59,6 +59,10 @@ module Gitlab
end
self.loaded = true
rescue GRPC::Unavailable, GRPC::DeadlineExceeded => e
# Handle Gitaly connection issues gracefully
Gitlab::ErrorTracking
.track_exception(e, project_id: project.id)
end
def load_from_project
......
......@@ -114,6 +114,24 @@ describe Gitlab::Cache::Ci::ProjectPipelineStatus, :clean_gitlab_redis_cache do
pipeline_status.load_status
pipeline_status.load_status
end
it 'handles Gitaly unavailable exceptions gracefully' do
allow(pipeline_status).to receive(:commit).and_raise(GRPC::Unavailable)
expect(Gitlab::ErrorTracking).to receive(:track_exception).with(
an_instance_of(GRPC::Unavailable), project_id: project.id
)
expect { pipeline_status.load_status }.not_to raise_error
end
it 'handles Gitaly timeout exceptions gracefully' do
allow(pipeline_status).to receive(:commit).and_raise(GRPC::DeadlineExceeded)
expect(Gitlab::ErrorTracking).to receive(:track_exception).with(
an_instance_of(GRPC::DeadlineExceeded), project_id: project.id
)
expect { pipeline_status.load_status }.not_to raise_error
end
end
describe "#load_from_project", :clean_gitlab_redis_cache do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment