Merge pull request #10372 from thaJeztah/bump_ttrpc_1.2.5

vendor: github.com/containerd/ttrpc v1.2.5
This commit is contained in:
Akihiro Suda 2024-06-21 01:23:47 +00:00 committed by GitHub
commit 9a94e9e78a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 16 additions and 16 deletions

2
go.mod
View File

@ -24,7 +24,7 @@ require (
github.com/containerd/nri v0.6.1 github.com/containerd/nri v0.6.1
github.com/containerd/platforms v0.2.1 github.com/containerd/platforms v0.2.1
github.com/containerd/plugin v0.1.0 github.com/containerd/plugin v0.1.0
github.com/containerd/ttrpc v1.2.4 github.com/containerd/ttrpc v1.2.5
github.com/containerd/typeurl/v2 v2.1.1 github.com/containerd/typeurl/v2 v2.1.1
github.com/containernetworking/cni v1.2.0 github.com/containernetworking/cni v1.2.0
github.com/containernetworking/plugins v1.4.1 github.com/containernetworking/plugins v1.4.1

4
go.sum
View File

@ -63,8 +63,8 @@ github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpS
github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw= github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw=
github.com/containerd/plugin v0.1.0 h1:CYMyZk9beRAIe1FEKItbMLLAz/z16aXrGc+B+nv0fU4= github.com/containerd/plugin v0.1.0 h1:CYMyZk9beRAIe1FEKItbMLLAz/z16aXrGc+B+nv0fU4=
github.com/containerd/plugin v0.1.0/go.mod h1:j6HlpMtkiZMgT4UsfVNxPBUkwdw9KQGU6nCLfRxnq+w= github.com/containerd/plugin v0.1.0/go.mod h1:j6HlpMtkiZMgT4UsfVNxPBUkwdw9KQGU6nCLfRxnq+w=
github.com/containerd/ttrpc v1.2.4 h1:eQCQK4h9dxDmpOb9QOOMh2NHTfzroH1IkmHiKZi05Oo= github.com/containerd/ttrpc v1.2.5 h1:IFckT1EFQoFBMG4c3sMdT8EP3/aKfumK1msY+Ze4oLU=
github.com/containerd/ttrpc v1.2.4/go.mod h1:ojvb8SJBSch0XkqNO0L0YX/5NxR3UnVk2LzFKBK0upc= github.com/containerd/ttrpc v1.2.5/go.mod h1:YCXHsb32f+Sq5/72xHubdiJRQY9inL4a4ZQrAbN1q9o=
github.com/containerd/typeurl/v2 v2.1.1 h1:3Q4Pt7i8nYwy2KmQWIw2+1hTvwTE/6w9FqcttATPO/4= github.com/containerd/typeurl/v2 v2.1.1 h1:3Q4Pt7i8nYwy2KmQWIw2+1hTvwTE/6w9FqcttATPO/4=
github.com/containerd/typeurl/v2 v2.1.1/go.mod h1:IDp2JFvbwZ31H8dQbEIY7sDl2L3o3HZj1hsSQlywkQ0= github.com/containerd/typeurl/v2 v2.1.1/go.mod h1:IDp2JFvbwZ31H8dQbEIY7sDl2L3o3HZj1hsSQlywkQ0=
github.com/containernetworking/cni v1.2.0 h1:fEjhlfWwWAXEvlcMQu/i6z8DA0Kbu7EcmR5+zb6cm5I= github.com/containernetworking/cni v1.2.0 h1:fEjhlfWwWAXEvlcMQu/i6z8DA0Kbu7EcmR5+zb6cm5I=

View File

@ -1,6 +1,6 @@
# ttrpc # ttrpc
[![Build Status](https://github.com/containerd/ttrpc/workflows/CI/badge.svg)](https://github.com/containerd/ttrpc/actions?query=workflow%3ACI) [![Build Status](https://github.com/containerd/ttrpc/actions/workflows/ci.yml/badge.svg)](https://github.com/containerd/ttrpc/actions/workflows/ci.yml)
GRPC for low-memory environments. GRPC for low-memory environments.

View File

@ -27,7 +27,7 @@ import (
"syscall" "syscall"
"time" "time"
"github.com/sirupsen/logrus" "github.com/containerd/log"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -368,7 +368,7 @@ func (c *Client) receiveLoop() error {
sid := streamID(msg.header.StreamID) sid := streamID(msg.header.StreamID)
s := c.getStream(sid) s := c.getStream(sid)
if s == nil { if s == nil {
logrus.WithField("stream", sid).Errorf("ttrpc: received message on inactive stream") log.G(c.ctx).WithField("stream", sid).Error("ttrpc: received message on inactive stream")
continue continue
} }
@ -376,7 +376,7 @@ func (c *Client) receiveLoop() error {
s.closeWithError(err) s.closeWithError(err)
} else { } else {
if err := s.receive(c.ctx, msg); err != nil { if err := s.receive(c.ctx, msg); err != nil {
logrus.WithError(err).WithField("stream", sid).Errorf("ttrpc: failed to handle message") log.G(c.ctx).WithFields(log.Fields{"error": err, "stream": sid}).Error("ttrpc: failed to handle message")
} }
} }
} }

View File

@ -27,7 +27,7 @@ import (
"syscall" "syscall"
"time" "time"
"github.com/sirupsen/logrus" "github.com/containerd/log"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
) )
@ -109,7 +109,7 @@ func (s *Server) Serve(ctx context.Context, l net.Listener) error {
} }
sleep := time.Duration(rand.Int63n(int64(backoff))) sleep := time.Duration(rand.Int63n(int64(backoff)))
logrus.WithError(err).Errorf("ttrpc: failed accept; backoff %v", sleep) log.G(ctx).WithError(err).Errorf("ttrpc: failed accept; backoff %v", sleep)
time.Sleep(sleep) time.Sleep(sleep)
continue continue
} }
@ -121,14 +121,14 @@ func (s *Server) Serve(ctx context.Context, l net.Listener) error {
approved, handshake, err := handshaker.Handshake(ctx, conn) approved, handshake, err := handshaker.Handshake(ctx, conn)
if err != nil { if err != nil {
logrus.WithError(err).Error("ttrpc: refusing connection after handshake") log.G(ctx).WithError(err).Error("ttrpc: refusing connection after handshake")
conn.Close() conn.Close()
continue continue
} }
sc, err := s.newConn(approved, handshake) sc, err := s.newConn(approved, handshake)
if err != nil { if err != nil {
logrus.WithError(err).Error("ttrpc: create connection failed") log.G(ctx).WithError(err).Error("ttrpc: create connection failed")
conn.Close() conn.Close()
continue continue
} }
@ -513,12 +513,12 @@ func (c *serverConn) run(sctx context.Context) {
Payload: response.data, Payload: response.data,
}) })
if err != nil { if err != nil {
logrus.WithError(err).Error("failed marshaling response") log.G(ctx).WithError(err).Error("failed marshaling response")
return return
} }
if err := ch.send(response.id, messageTypeResponse, 0, p); err != nil { if err := ch.send(response.id, messageTypeResponse, 0, p); err != nil {
logrus.WithError(err).Error("failed sending message on channel") log.G(ctx).WithError(err).Error("failed sending message on channel")
return return
} }
} else { } else {
@ -530,7 +530,7 @@ func (c *serverConn) run(sctx context.Context) {
flags = flags | flagNoData flags = flags | flagNoData
} }
if err := ch.send(response.id, messageTypeData, flags, response.data); err != nil { if err := ch.send(response.id, messageTypeData, flags, response.data); err != nil {
logrus.WithError(err).Error("failed sending message on channel") log.G(ctx).WithError(err).Error("failed sending message on channel")
return return
} }
} }
@ -552,7 +552,7 @@ func (c *serverConn) run(sctx context.Context) {
// requests, so that the client connection is closed // requests, so that the client connection is closed
return return
} }
logrus.WithError(err).Error("error receiving message") log.G(ctx).WithError(err).Error("error receiving message")
// else, initiate shutdown // else, initiate shutdown
case <-shutdown: case <-shutdown:
return return

2
vendor/modules.txt vendored
View File

@ -185,7 +185,7 @@ github.com/containerd/platforms
github.com/containerd/plugin github.com/containerd/plugin
github.com/containerd/plugin/dynamic github.com/containerd/plugin/dynamic
github.com/containerd/plugin/registry github.com/containerd/plugin/registry
# github.com/containerd/ttrpc v1.2.4 # github.com/containerd/ttrpc v1.2.5
## explicit; go 1.19 ## explicit; go 1.19
github.com/containerd/ttrpc github.com/containerd/ttrpc
# github.com/containerd/typeurl/v2 v2.1.1 # github.com/containerd/typeurl/v2 v2.1.1