Skip to content

Commit 9d9ccdb

Browse files
zeripathlunny
andauthored
Don't report signal: killed errors in serviceRPC (#18850) (#18865)
Backport #18850 Fix #18849 Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: Lunny Xiao <[email protected]>
1 parent 81b29d6 commit 9d9ccdb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

routers/web/repo/http.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func httpBase(ctx *context.Context) (h *serviceHandler) {
103103
}
104104

105105
isWiki := false
106-
var unitType = unit.TypeCode
106+
unitType := unit.TypeCode
107107
var wikiRepoName string
108108
if strings.HasSuffix(reponame, ".wiki") {
109109
isWiki = true
@@ -456,7 +456,6 @@ func serviceRPC(h serviceHandler, service string) {
456456
if err := h.r.Body.Close(); err != nil {
457457
log.Error("serviceRPC: Close: %v", err)
458458
}
459-
460459
}()
461460

462461
if !hasAccess(service, h, true) {
@@ -467,7 +466,7 @@ func serviceRPC(h serviceHandler, service string) {
467466
h.w.Header().Set("Content-Type", fmt.Sprintf("application/x-git-%s-result", service))
468467

469468
var err error
470-
var reqBody = h.r.Body
469+
reqBody := h.r.Body
471470

472471
// Handle GZIP.
473472
if h.r.Header.Get("Content-Encoding") == "gzip" {
@@ -502,7 +501,9 @@ func serviceRPC(h serviceHandler, service string) {
502501
cmd.Stderr = &stderr
503502

504503
if err := cmd.Run(); err != nil {
505-
log.Error("Fail to serve RPC(%s) in %s: %v - %s", service, h.dir, err, stderr.String())
504+
if err.Error() != "signal: killed" {
505+
log.Error("Fail to serve RPC(%s) in %s: %v - %s", service, h.dir, err, stderr.String())
506+
}
506507
return
507508
}
508509
}

0 commit comments

Comments
 (0)