MCPcopy
hub / github.com/containerd/containerd / Stop

Method Stop

cmd/containerd/server/server.go:270–286  ·  view source on GitHub ↗

Stop the containerd server canceling any open connections

()

Source from the content-addressed store, hash-verified

268
269// Stop the containerd server canceling any open connections
270func (s *Server) Stop() {
271 for i := len(s.plugins) - 1; i >= 0; i-- {
272 p := s.plugins[i]
273 instance, err := p.Instance()
274 if err != nil {
275 log.L.WithFields(log.Fields{"error": err, "id": p.Registration.URI()}).Error("could not get plugin instance")
276 continue
277 }
278 closer, ok := instance.(io.Closer)
279 if !ok {
280 continue
281 }
282 if err := closer.Close(); err != nil {
283 log.L.WithFields(log.Fields{"error": err, "id": p.Registration.URI()}).Error("failed to close plugin")
284 }
285 }
286}
287
288func (s *Server) RegisterReadiness() func() {
289 s.ready.Add(1)

Callers 3

handleSignalsFunction · 0.95
handleSignalsFunction · 0.95
AppFunction · 0.95

Calls 2

CloseMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected