From 29ed79d418a98035fbad08148903c9e1768b32ba Mon Sep 17 00:00:00 2001 From: marcos Date: Fri, 24 Nov 2017 00:45:00 -0300 Subject: [PATCH] Fix issue with scheduler mutex. Update k8s motd with new kubedashboard url --- dockerfiles/k8s/motd | 4 +--- scheduler/scheduler.go | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dockerfiles/k8s/motd b/dockerfiles/k8s/motd index e7b9f82..c913b54 100644 --- a/dockerfiles/k8s/motd +++ b/dockerfiles/k8s/motd @@ -20,9 +20,7 @@ 3. (Optional) Initialize kube-dashboard: - curl -L -s https://git.io/kube-dashboard | sed 's/targetPort: 9090/targetPort: 9090\n type: LoadBalancer/' | \ - kubectl apply -f - - +curl -L -s https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml | sed 's/targetPort: 8443/targetPort: 8443\n type: LoadBalancer/' | kubectl apply -f - The PWK team. diff --git a/scheduler/scheduler.go b/scheduler/scheduler.go index fe27370..6a621cb 100644 --- a/scheduler/scheduler.go +++ b/scheduler/scheduler.go @@ -310,10 +310,11 @@ func (s *scheduler) Start() error { }) s.event.On(event.PLAYGROUND_NEW, func(playgroundId string, args ...interface{}) { s.mx.Lock() - defer s.mx.Unlock() log.Printf("EVENT: Playground New %s\n", playgroundId) + // Don't defer lock as updatePlaygrounds will lock again + s.mx.Unlock() // We just update all playgrounds we manage to be safe. This is pretty fast anyway and this event should be fairly rare s.updatePlaygrounds() })