New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.03.x] Update containerd to 595e75c212d19a81d2b808a518fe1afc1391dad5 #31662

Merged
merged 1 commit into from Mar 10, 2017

Conversation

Projects
None yet
5 participants
@mlaventure
Contributor

mlaventure commented Mar 8, 2017

Signed-off-by: Kenfe-Mickael Laventure mickael.laventure@gmail.com

--

Closes #31622, #31479, #31074
Closes #30984 (it's the second part of the fix :))

diff:

diff --git a/containerd/main.go b/containerd/main.go
index 568e453..68bdd8e 100644
--- a/containerd/main.go
+++ b/containerd/main.go
@@ -20,7 +20,7 @@ import (
 	"github.com/codegangsta/cli"
 	"github.com/cyberdelia/go-metrics-graphite"
 	"github.com/docker/containerd"
-	"github.com/docker/containerd/api/grpc/server"
+	grpcserver "github.com/docker/containerd/api/grpc/server"
 	"github.com/docker/containerd/api/grpc/types"
 	"github.com/docker/containerd/api/http/pprof"
 	"github.com/docker/containerd/supervisor"
@@ -159,6 +159,17 @@ func main() {
 func daemon(context *cli.Context) error {
 	s := make(chan os.Signal, 2048)
 	signal.Notify(s, syscall.SIGTERM, syscall.SIGINT)
+	// Split the listen string of the form proto://addr
+	listenSpec := context.String("listen")
+	listenParts := strings.SplitN(listenSpec, "://", 2)
+	if len(listenParts) != 2 {
+		return fmt.Errorf("bad listen address format %s, expected proto://address", listenSpec)
+	}
+	// Register server early to allow healthcheck to be done
+	server, err := startServer(listenParts[0], listenParts[1])
+	if err != nil {
+		return err
+	}
 	sv, err := supervisor.New(
 		context.String("state-dir"),
 		context.String("runtime"),
@@ -169,6 +180,7 @@ func daemon(context *cli.Context) error {
 	if err != nil {
 		return err
 	}
+	types.RegisterAPIServer(server, grpcserver.NewServer(sv))
 	wg := &sync.WaitGroup{}
 	for i := 0; i < 10; i++ {
 		wg.Add(1)
@@ -178,16 +190,6 @@ func daemon(context *cli.Context) error {
 	if err := sv.Start(); err != nil {
 		return err
 	}
-	// Split the listen string of the form proto://addr
-	listenSpec := context.String("listen")
-	listenParts := strings.SplitN(listenSpec, "://", 2)
-	if len(listenParts) != 2 {
-		return fmt.Errorf("bad listen address format %s, expected proto://address", listenSpec)
-	}
-	server, err := startServer(listenParts[0], listenParts[1], sv)
-	if err != nil {
-		return err
-	}
 	for ss := range s {
 		switch ss {
 		default:
@@ -199,7 +201,7 @@ func daemon(context *cli.Context) error {
 	return nil
 }
 
-func startServer(protocol, address string, sv *supervisor.Supervisor) (*grpc.Server, error) {
+func startServer(protocol, address string) (*grpc.Server, error) {
 	// TODO: We should use TLS.
 	// TODO: Add an option for the SocketGroup.
 	sockets, err := listeners.Init(protocol, address, "", nil)
@@ -211,7 +213,6 @@ func startServer(protocol, address string, sv *supervisor.Supervisor) (*grpc.Ser
 	}
 	l := sockets[0]
 	s := grpc.NewServer()
-	types.RegisterAPIServer(s, server.NewServer(sv))
 	healthServer := health.NewServer()
 	grpc_health_v1.RegisterHealthServer(s, healthServer)
 
diff --git a/supervisor/supervisor.go b/supervisor/supervisor.go
index 1c19339..e1fd5d6 100644
--- a/supervisor/supervisor.go
+++ b/supervisor/supervisor.go
@@ -331,7 +331,9 @@ func (s *Supervisor) restore() error {
 		id := d.Name()
 		container, err := runtime.Load(s.stateDir, id, s.shim, s.timeout)
 		if err != nil {
-			return err
+			logrus.WithFields(logrus.Fields{"error": err, "id": id}).Warnf("containerd: failed to load container,removing state directory.")
+			os.RemoveAll(filepath.Join(s.stateDir, id))
+			continue
 		}
 		processes, err := container.Processes()
 		if err != nil {

@mlaventure mlaventure added this to the 17.03.1 milestone Mar 8, 2017

@cpuguy83

This comment has been minimized.

Show comment
Hide comment
@cpuguy83

cpuguy83 Mar 9, 2017

Contributor
Conflicting files
hack/dockerfile/binaries-commits
Contributor

cpuguy83 commented Mar 9, 2017

Conflicting files
hack/dockerfile/binaries-commits
Update containerd to 595e75c212d19a81d2b808a518fe1afc1391dad5
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
@mlaventure

This comment has been minimized.

Show comment
Hide comment
@mlaventure

mlaventure Mar 9, 2017

Contributor

Updated

Contributor

mlaventure commented Mar 9, 2017

Updated

@cpuguy83

LGTM

@vdemeester

LGTM 🐸

@justincormack

This comment has been minimized.

Show comment
Hide comment
@justincormack

justincormack Mar 10, 2017

Contributor

ignoring P&Z as jenkins wired up wrong and we cant see output, so merging.

Contributor

justincormack commented Mar 10, 2017

ignoring P&Z as jenkins wired up wrong and we cant see output, so merging.

@justincormack justincormack merged commit 4bd1b71 into moby:17.03.x Mar 10, 2017

5 of 7 checks passed

powerpc Jenkins build is being scheduled
Details
z Jenkins build is being scheduled
Details
dco-signed All commits are signed
experimental Jenkins build Docker-PRs-experimental 31516 has succeeded
Details
janky Jenkins build Docker-PRs 40135 has succeeded
Details
vendor Jenkins build Docker-PRs-vendor 2957 has succeeded
Details
windowsRS1 Jenkins build Docker-PRs-WoW-RS1 11212 has succeeded
Details

@thaJeztah thaJeztah changed the title from Update containerd to 595e75c212d19a81d2b808a518fe1afc1391dad5 to [17.03.x] Update containerd to 595e75c212d19a81d2b808a518fe1afc1391dad5 Mar 13, 2017

runcom added a commit to projectatomic/containerd that referenced this pull request Jan 19, 2018

BACKPORT: Fix BZ#1529300
moby/moby#31662
moby/moby#31852

Signed-off-by: Antonio Murdaca <runcom@redhat.com>

runcom added a commit to projectatomic/containerd that referenced this pull request Jan 19, 2018

BACKPORT: Fix BZ#1529300
moby/moby#31662
moby/moby#31852

Signed-off-by: Antonio Murdaca <runcom@redhat.com>

runcom added a commit to projectatomic/containerd that referenced this pull request Jan 19, 2018

BACKPORT: Fix BZ#1529300
moby/moby#31662
moby/moby#31852

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment