Workhorse returns 200 when Get file archive api call fails
Summary
When the call the Get file archive api fails on Gitaly (for example exceeding the 60s timeout for the request), Workhorse responds with a 200
status and the error "_source.error": "SendArchive: copy 'git archive' output: rpc error: code = Canceled desc = context canceled"
.
The status should be an error status such as 5xx
.
Steps to reproduce
N/A
Example Project
N/A
What is the current bug behavior?
Workhorse returns as 200 response when the Get file archive api fails on Gitaly
What is the expected correct behavior?
Workhorse returns a 5xx (or similar) response when the Get file archive api fails on Gitaly
Relevant logs and/or screenshots
N/A
Output of checks
N/A
This bug happens on GitLab.com
Results of GitLab environment info
N/A
Possible fixes
Fix in the code https://gitlab.com/gitlab-org/gitlab/-/blob/master/workhorse/internal/git/archive.go?ref_type=heads#L118,
w.WriteHeader(200) // Don't bother with HTTP 500 from this point on, just return
if _, err := io.Copy(w, reader); err != nil {
log.WithRequest(r).WithError(©Error{fmt.Errorf("SendArchive: copy 'git archive' output: %v", err)}).Error()
return
}