MCPcopy
hub / github.com/containerd/containerd / Reconnect

Method Reconnect

client/client.go:238–251  ·  view source on GitHub ↗

Reconnect re-establishes the GRPC connection to the containerd daemon

()

Source from the content-addressed store, hash-verified

236
237// Reconnect re-establishes the GRPC connection to the containerd daemon
238func (c *Client) Reconnect() error {
239 if c.connector == nil {
240 return fmt.Errorf("unable to reconnect to containerd, no connector available: %w", errdefs.ErrUnavailable)
241 }
242 c.connMu.Lock()
243 defer c.connMu.Unlock()
244 c.conn.Close()
245 conn, err := c.connector()
246 if err != nil {
247 return err
248 }
249 c.conn = conn
250 return nil
251}
252
253// Runtime returns the name of the runtime being used
254func (c *Client) Runtime() string {

Callers 2

TestClientReconnectFunction · 0.45

Calls 3

LockMethod · 0.65
UnlockMethod · 0.65
CloseMethod · 0.65

Tested by 2

TestClientReconnectFunction · 0.36