diff options
author | John Cai <jcai@gitlab.com> | 2020-01-24 23:03:04 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2020-01-24 23:03:04 +0300 |
commit | 1ef0443ab045b602eb2a8e076f3d5c3f5e4226db (patch) | |
tree | a4ab84d872ce70e743e18d87574d3e04dafb4e13 | |
parent | 17af6ea8b44cbd621022c108e1c116b794181be0 (diff) | |
parent | e3e772782fc66f73c1c35b28056a6b21c08ecd5c (diff) |
Merge branch 'wc-health-log' into 'master'
Clarify failed Gitaly-Ruby connection log event
See merge request gitlab-org/gitaly!1776
-rw-r--r-- | changelogs/unreleased/wc-health-log.yml | 5 | ||||
-rw-r--r-- | internal/rubyserver/health.go | 3 | ||||
-rw-r--r-- | internal/rubyserver/rubyserver.go | 2 | ||||
-rw-r--r-- | internal/rubyserver/worker.go | 6 |
4 files changed, 11 insertions, 5 deletions
diff --git a/changelogs/unreleased/wc-health-log.yml b/changelogs/unreleased/wc-health-log.yml new file mode 100644 index 000000000..433f4352a --- /dev/null +++ b/changelogs/unreleased/wc-health-log.yml @@ -0,0 +1,5 @@ +--- +title: Explicitly mention gitaly-ruby in error messages +merge_request: 1776 +author: +type: other diff --git a/internal/rubyserver/health.go b/internal/rubyserver/health.go index 07c2369aa..cf12a8e63 100644 --- a/internal/rubyserver/health.go +++ b/internal/rubyserver/health.go @@ -2,6 +2,7 @@ package rubyserver import ( "context" + "fmt" "net" "time" @@ -22,7 +23,7 @@ func ping(address string) error { }), ) if err != nil { - return err + return fmt.Errorf("failed to connect to gitaly-ruby worker: %v", err) } defer conn.Close() diff --git a/internal/rubyserver/rubyserver.go b/internal/rubyserver/rubyserver.go index c95b6934d..d3e8863f8 100644 --- a/internal/rubyserver/rubyserver.go +++ b/internal/rubyserver/rubyserver.go @@ -233,7 +233,7 @@ func (s *Server) createConnection(ctx context.Context) (*grpc.ClientConn, error) conn, err := grpc.DialContext(dialCtx, balancer.Scheme+":///gitaly-ruby", dialOptions()...) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to connect to gitaly-ruby worker: %v", err) } s.clientConn = conn diff --git a/internal/rubyserver/worker.go b/internal/rubyserver/worker.go index 4dd44ae8f..160e83c48 100644 --- a/internal/rubyserver/worker.go +++ b/internal/rubyserver/worker.go @@ -131,7 +131,7 @@ func (w *worker) monitor() { // we may leave the system without the capacity to make gitaly-ruby // requests. if bal.RemoveAddress(w.address) { - w.logPid(currentPid).Info("removed from balancer due to high memory") + w.logPid(currentPid).Info("removed gitaly-ruby worker from balancer due to high memory") go w.waitTerminate(currentPid) swMem.reset() } @@ -154,7 +154,7 @@ func (w *worker) monitor() { break nextEvent } - w.log().WithError(e.Error).Warn("health check failed") + w.log().WithError(e.Error).Warn("gitaly-ruby worker health check failed") swHealth.mark() if swHealth.elapsed() <= healthRestartDelay { @@ -162,7 +162,7 @@ func (w *worker) monitor() { } if bal.RemoveAddress(w.address) { - w.logPid(currentPid).Info("removed from balancer due to sustained failing health checks") + w.logPid(currentPid).Info("removed gitaly-ruby worker from balancer due to sustained failing health checks") go w.waitTerminate(currentPid) swHealth.reset() } |