diff --git a/nucleus/controller.go b/nucleus/controller.go
index 169a4ee5205665f6e969ec1c12a0acf70a4231a0..4e96a290b394a596dd2568b73305f1f7a27f7dc8 100644
--- a/nucleus/controller.go
+++ b/nucleus/controller.go
@@ -99,5 +99,7 @@ func Run(ctx context.Context) error {
 
 func shutdown() error {
 	log.Info("shutting down controller")
+	coreLock.Lock()
+	defer coreLock.Unlock()
 	return stopHttpServer()
 }