Merge pull request #2432 from crosbymichael/ttrpc2

Update ttrpc to 94dde388801693c54f88a6596f713b51a8
This commit is contained in:
Kenfe-Mickaël Laventure 2018-07-02 13:37:50 -07:00 committed by GitHub
commit 4e64dcce85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View File

@ -172,7 +172,7 @@ func serve(server *ttrpc.Server, path string) error {
logrus.WithField("socket", path).Debug("serving api on unix socket") logrus.WithField("socket", path).Debug("serving api on unix socket")
go func() { go func() {
defer l.Close() defer l.Close()
if err := server.Serve(l); err != nil && if err := server.Serve(context.Background(), l); err != nil &&
!strings.Contains(err.Error(), "use of closed network connection") { !strings.Contains(err.Error(), "use of closed network connection") {
logrus.WithError(err).Fatal("containerd-shim: ttrpc server failure") logrus.WithError(err).Fatal("containerd-shim: ttrpc server failure")
} }

View File

@ -37,7 +37,7 @@ github.com/Microsoft/hcsshim v0.6.11
github.com/boltdb/bolt e9cf4fae01b5a8ff89d0ec6b32f0d9c9f79aefdd github.com/boltdb/bolt e9cf4fae01b5a8ff89d0ec6b32f0d9c9f79aefdd
google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944 google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944
golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4 golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4
github.com/containerd/ttrpc fa6c68143601db58b3636ee9948aad2fe08ed1ea github.com/containerd/ttrpc 94dde388801693c54f88a6596f713b51a8b30b2d
github.com/syndtr/gocapability db04d3cc01c8b54962a58ec7e491717d06cfcc16 github.com/syndtr/gocapability db04d3cc01c8b54962a58ec7e491717d06cfcc16
gotest.tools v2.1.0 gotest.tools v2.1.0
github.com/google/go-cmp v0.1.0 github.com/google/go-cmp v0.1.0

View File

@ -67,12 +67,11 @@ func (s *Server) Register(name string, methods map[string]Method) {
s.services.register(name, methods) s.services.register(name, methods)
} }
func (s *Server) Serve(l net.Listener) error { func (s *Server) Serve(ctx context.Context, l net.Listener) error {
s.addListener(l) s.addListener(l)
defer s.closeListener(l) defer s.closeListener(l)
var ( var (
ctx = context.Background()
backoff time.Duration backoff time.Duration
handshaker = s.config.handshaker handshaker = s.config.handshaker
) )