Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Newdigate <andrew@gitlab.com>2018-11-16 16:43:08 +0300
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-11-16 16:43:08 +0300
commitbee7719e45ffa4602e7b431d6e36a22c8c502bb0 (patch)
tree2229ca5321d26a9dea9907372facbb84c963cdbc /internal/rubyserver
parentf3840074e88b5c1cf6b78eaa28c5cfd6e1d76e2c (diff)
Upgrade grpc-go from v1.9.1 to v1.16.0 in preparation for correlation ids
Diffstat (limited to 'internal/rubyserver')
-rw-r--r--internal/rubyserver/health.go4
-rw-r--r--internal/rubyserver/rubyserver.go11
2 files changed, 4 insertions, 11 deletions
diff --git a/internal/rubyserver/health.go b/internal/rubyserver/health.go
index fd7b32747..10550d7dc 100644
--- a/internal/rubyserver/health.go
+++ b/internal/rubyserver/health.go
@@ -1,7 +1,6 @@
package rubyserver
import (
- "net"
"time"
"golang.org/x/net/context"
@@ -13,9 +12,6 @@ func ping(address string) error {
conn, err := grpc.Dial(
address,
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
)
if err != nil {
return err
diff --git a/internal/rubyserver/rubyserver.go b/internal/rubyserver/rubyserver.go
index 3fdfc31f7..99cb290a5 100644
--- a/internal/rubyserver/rubyserver.go
+++ b/internal/rubyserver/rubyserver.go
@@ -3,7 +3,6 @@ package rubyserver
import (
"fmt"
"io/ioutil"
- "net"
"os"
"path"
"path/filepath"
@@ -126,6 +125,7 @@ func Start() (*Server, error) {
for i := 0; i < numWorkers; i++ {
name := fmt.Sprintf("gitaly-ruby.%d", i)
socketPath := socketPath(i)
+ address := "unix://" + socketPath
// Use 'ruby-cd' to make sure gitaly-ruby has the same working directory
// as the current process. This is a hack to sort-of support relative
@@ -133,13 +133,13 @@ func Start() (*Server, error) {
args := []string{"bundle", "exec", "bin/ruby-cd", wd, gitalyRuby, strconv.Itoa(os.Getpid()), socketPath}
events := make(chan supervisor.Event)
- check := func() error { return ping(socketPath) }
+ check := func() error { return ping(address) }
p, err := supervisor.New(name, env, args, cfg.Ruby.Dir, cfg.Ruby.MaxRSS, events, check)
if err != nil {
return nil, err
}
- s.workers = append(s.workers, newWorker(p, socketPath, events, false))
+ s.workers = append(s.workers, newWorker(p, address, events, false))
}
return s, nil
@@ -240,7 +240,7 @@ func (s *Server) createConnection(ctx context.Context) (*grpc.ClientConn, error)
dialCtx, cancel := context.WithTimeout(ctx, ConnectTimeout)
defer cancel()
- conn, err := grpc.DialContext(dialCtx, balancer.Scheme+"://gitaly-ruby", dialOptions()...)
+ conn, err := grpc.DialContext(dialCtx, balancer.Scheme+":///gitaly-ruby", dialOptions()...)
if err != nil {
return nil, err
}
@@ -253,9 +253,6 @@ func dialOptions() []grpc.DialOption {
return []grpc.DialOption{
grpc.WithBlock(), // With this we get retries. Without, connections fail fast.
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
grpc.WithUnaryInterceptor(grpc_prometheus.UnaryClientInterceptor),
grpc.WithStreamInterceptor(grpc_prometheus.StreamClientInterceptor),
}