From 386ad44151e8d64a6b3da2ddda82d3870b84fa0d Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Fri, 17 Jan 2020 17:25:26 +0000 Subject: [PATCH] clh: revert agent changes to check clh stability DEBUG Fixes: #666 Signed-off-by: Jose Carlos Venegas Munoz --- Gopkg.lock | 4 +-- Gopkg.toml | 2 +- .../agent/protocols/client/client.go | 27 +++++-------------- 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index b9deb339ea..53d27790ee 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -419,7 +419,7 @@ revision = "8cba5a8e5f2816f26f9dc34b8ea968279a5a76eb" [[projects]] - digest = "1:6da9487ef0cc0cca3eeb1a24e3bb018ce2e07b7c2fc4d50975b54efdcc942118" + digest = "1:903bfb87f41dc18a533d327b5b03fd2f562f34deafcbd0db93d4be3fa8d6099c" name = "github.com/kata-containers/agent" packages = [ "pkg/types", @@ -427,7 +427,7 @@ "protocols/grpc", ] pruneopts = "NUT" - revision = "1b3628c43660cb198ec055d78e5c7b03809cba60" + revision = "a74056c0a1d70779672841ec40494ad0bdba9481" [[projects]] digest = "1:58999a98719fddbac6303cb17e8d85b945f60b72f48e3a2df6b950b97fa926f1" diff --git a/Gopkg.toml b/Gopkg.toml index e5d65bec20..d5e786fbeb 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -52,7 +52,7 @@ [[constraint]] name = "github.com/kata-containers/agent" - revision = "1b3628c43660cb198ec055d78e5c7b03809cba60" + revision = "a74056c0a1d70779672841ec40494ad0bdba9481" [[constraint]] name = "github.com/containerd/cri-containerd" diff --git a/vendor/github.com/kata-containers/agent/protocols/client/client.go b/vendor/github.com/kata-containers/agent/protocols/client/client.go index 43b9a94525..911c252ef8 100644 --- a/vendor/github.com/kata-containers/agent/protocols/client/client.go +++ b/vendor/github.com/kata-containers/agent/protocols/client/client.go @@ -9,19 +9,16 @@ package client import ( "context" "fmt" - "io" "net" "net/url" "strconv" "strings" - "syscall" "time" "github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc" "github.com/hashicorp/yamux" "github.com/mdlayher/vsock" opentracing "github.com/opentracing/opentracing-go" - "golang.org/x/sys/unix" "google.golang.org/grpc" "google.golang.org/grpc/codes" grpcStatus "google.golang.org/grpc/status" @@ -410,24 +407,12 @@ func HybridVSockDialer(sock string, timeout time.Duration) (net.Conn, error) { return nil, err } - // Receive the packet from the connection without removing it from - // the receive queue (MSG_PEEK), ensuring the connection is usable. - if uc, ok := conn.(*net.UnixConn); ok { - file, err := uc.File() - if err != nil { - conn.Close() - return nil, err - } - eot := make([]byte, 1) - n, _, err := unix.Recvfrom(int(file.Fd()), eot, syscall.MSG_PEEK) - file.Close() - if err != nil || n == 0 { - conn.Close() - if err == nil { - err = io.EOF - } - return nil, err - } + // Read EOT (End of transmission) byte + eot := make([]byte, 32) + if _, err = conn.Read(eot); err != nil { + // Just close the connection, gRPC will dial again + // without errors + conn.Close() } return conn, nil