diff options
author | zeripath <art27@cantab.net> | 2022-02-24 08:59:50 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-24 16:59:50 +0800 |
commit | 9d9ccdbe434992d21b418eefae0ecc32a5f22b14 (patch) | |
tree | e38f3cb1ba4b07b648919cb5231790dcbb492c46 | |
parent | 81b29d6263aff460e8321464a8e473efac7a103d (diff) | |
download | gitea-9d9ccdbe434992d21b418eefae0ecc32a5f22b14.tar.gz gitea-9d9ccdbe434992d21b418eefae0ecc32a5f22b14.zip |
Don't report signal: killed errors in serviceRPC (#18850) (#18865)
Backport #18850
Fix #18849
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
-rw-r--r-- | routers/web/repo/http.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/routers/web/repo/http.go b/routers/web/repo/http.go index f5ca7f1856..dbb1acee0c 100644 --- a/routers/web/repo/http.go +++ b/routers/web/repo/http.go @@ -103,7 +103,7 @@ func httpBase(ctx *context.Context) (h *serviceHandler) { } isWiki := false - var unitType = unit.TypeCode + unitType := unit.TypeCode var wikiRepoName string if strings.HasSuffix(reponame, ".wiki") { isWiki = true @@ -456,7 +456,6 @@ func serviceRPC(h serviceHandler, service string) { if err := h.r.Body.Close(); err != nil { log.Error("serviceRPC: Close: %v", err) } - }() if !hasAccess(service, h, true) { @@ -467,7 +466,7 @@ func serviceRPC(h serviceHandler, service string) { h.w.Header().Set("Content-Type", fmt.Sprintf("application/x-git-%s-result", service)) var err error - var reqBody = h.r.Body + reqBody := h.r.Body // Handle GZIP. if h.r.Header.Get("Content-Encoding") == "gzip" { @@ -502,7 +501,9 @@ func serviceRPC(h serviceHandler, service string) { cmd.Stderr = &stderr if err := cmd.Run(); err != nil { - log.Error("Fail to serve RPC(%s) in %s: %v - %s", service, h.dir, err, stderr.String()) + if err.Error() != "signal: killed" { + log.Error("Fail to serve RPC(%s) in %s: %v - %s", service, h.dir, err, stderr.String()) + } return } } |