mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: github.com/containerd/ttrpc v1.2.5
full diff: https://github.com/containerd/ttrpc/compare/v1.2.4...v1.2.5 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
2
vendor/github.com/containerd/ttrpc/README.md
generated
vendored
2
vendor/github.com/containerd/ttrpc/README.md
generated
vendored
@ -1,6 +1,6 @@
|
||||
# ttrpc
|
||||
|
||||
[](https://github.com/containerd/ttrpc/actions?query=workflow%3ACI)
|
||||
[](https://github.com/containerd/ttrpc/actions/workflows/ci.yml)
|
||||
|
||||
GRPC for low-memory environments.
|
||||
|
||||
|
6
vendor/github.com/containerd/ttrpc/client.go
generated
vendored
6
vendor/github.com/containerd/ttrpc/client.go
generated
vendored
@ -27,7 +27,7 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/containerd/log"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/proto"
|
||||
@ -368,7 +368,7 @@ func (c *Client) receiveLoop() error {
|
||||
sid := streamID(msg.header.StreamID)
|
||||
s := c.getStream(sid)
|
||||
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
|
||||
}
|
||||
|
||||
@ -376,7 +376,7 @@ func (c *Client) receiveLoop() error {
|
||||
s.closeWithError(err)
|
||||
} else {
|
||||
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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
16
vendor/github.com/containerd/ttrpc/server.go
generated
vendored
16
vendor/github.com/containerd/ttrpc/server.go
generated
vendored
@ -27,7 +27,7 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/containerd/log"
|
||||
"google.golang.org/grpc/codes"
|
||||
"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)))
|
||||
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)
|
||||
continue
|
||||
}
|
||||
@ -121,14 +121,14 @@ func (s *Server) Serve(ctx context.Context, l net.Listener) error {
|
||||
|
||||
approved, handshake, err := handshaker.Handshake(ctx, conn)
|
||||
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()
|
||||
continue
|
||||
}
|
||||
|
||||
sc, err := s.newConn(approved, handshake)
|
||||
if err != nil {
|
||||
logrus.WithError(err).Error("ttrpc: create connection failed")
|
||||
log.G(ctx).WithError(err).Error("ttrpc: create connection failed")
|
||||
conn.Close()
|
||||
continue
|
||||
}
|
||||
@ -513,12 +513,12 @@ func (c *serverConn) run(sctx context.Context) {
|
||||
Payload: response.data,
|
||||
})
|
||||
if err != nil {
|
||||
logrus.WithError(err).Error("failed marshaling response")
|
||||
log.G(ctx).WithError(err).Error("failed marshaling response")
|
||||
return
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
} else {
|
||||
@ -530,7 +530,7 @@ func (c *serverConn) run(sctx context.Context) {
|
||||
flags = flags | flagNoData
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
@ -552,7 +552,7 @@ func (c *serverConn) run(sctx context.Context) {
|
||||
// requests, so that the client connection is closed
|
||||
return
|
||||
}
|
||||
logrus.WithError(err).Error("error receiving message")
|
||||
log.G(ctx).WithError(err).Error("error receiving message")
|
||||
// else, initiate shutdown
|
||||
case <-shutdown:
|
||||
return
|
||||
|
Reference in New Issue
Block a user