1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 14:48:55 +00:00

Fix containerds stomping on each other

This commit is contained in:
Darren Shepherd
2016-06-15 16:33:27 -07:00
parent e98fc80d12
commit e1a63c80f3
8 changed files with 61 additions and 16 deletions

View File

@@ -31,6 +31,7 @@ func (s *Subscription) SetPid(pid int) {
s.exit = exit
s.wg.Done()
Unsubscribe(s)
break
}
}
}()
@@ -61,7 +62,10 @@ func Unsubscribe(sub *Subscription) {
subLock.Lock()
defer subLock.Unlock()
delete(subscriptions, sub.id)
if _, ok := subscriptions[sub.id]; ok {
close(sub.c)
delete(subscriptions, sub.id)
}
}
func Start() error {

View File

@@ -225,7 +225,7 @@ func (r *remote) handleEventStream(events containerd.API_EventsClient) {
func (r *remote) runContainerdDaemon() error {
var err error
r.apiClient, err = newBridge(stateDir, 10, "docker-runc", r.runtimeArgs)
r.apiClient, err = newBridge(r.stateDir, 10, "docker-runc", r.runtimeArgs)
return err
}

View File

@@ -1,6 +1,7 @@
package libcontainerd
import (
"path/filepath"
"sync"
"time"
@@ -11,10 +12,6 @@ import (
"github.com/docker/containerd/supervisor"
)
var (
stateDir = "/run/containerd"
)
type bridge struct {
s types.APIServer
}
@@ -31,7 +28,7 @@ func daemon(stateDir string, concurrency int, runtimeName string, runtimeArgs []
if err := subreaper.Start(); err != nil {
logrus.WithField("error", err).Error("containerd: start subreaper")
}
sv, err := supervisor.New(stateDir, runtimeName, "", runtimeArgs, 15*time.Second, 500)
sv, err := supervisor.New(filepath.Join(stateDir, "containerd"), runtimeName, "", runtimeArgs, 15*time.Second, 500)
if err != nil {
return nil, err
}

View File

@@ -14,7 +14,7 @@ github.com/codegangsta/cli 9fec0fad02befc9209347cc6d620e68e1b45f74d
github.com/coreos/etcd v2.2.0
github.com/coreos/go-systemd v4
github.com/deckarep/golang-set ef32fa3046d9f249d399f98ebaf9be944430fd1d
github.com/docker/containerd 8c538d6b92f2c512c3ad8a854826461ac9095b74 https://github.com/ibuildthecloud/containerd.git
github.com/docker/containerd 1674135d5e32ea16d2ed0967f00325c7276b984b https://github.com/ibuildthecloud/containerd.git
github.com/docker/distribution 467fc068d88aa6610691b7f1a677271a3fac4aac
github.com/docker/engine-api v0.3.3
github.com/docker/go v1.5.1-1-1-gbaf439e