From 10c3d9f80fa1584ea37eb0465748d35341d9d227 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Wed, 14 Jan 2015 15:26:42 -0800 Subject: [PATCH] Use graphdb.Walk with depth=1 in /containers I don't think that it was very useful feature in current implementation, but when you have a lot of links - your daemon became unusable because on first call of /containers global graphdb lock will be acquired and it can take a lot of time: 30m for 15 containers linked to each other. Links names can be seen with `--no-trunc`, but I think it's useless :) Fixes #9967 Signed-off-by: Alexander Morozov --- daemon/list.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/daemon/list.go b/daemon/list.go index 5ca01862ef..5885ebd499 100644 --- a/daemon/list.go +++ b/daemon/list.go @@ -54,12 +54,11 @@ func (daemon *Daemon) Containers(job *engine.Job) engine.Status { } } } - names := map[string][]string{} daemon.ContainerGraph().Walk("/", func(p string, e *graphdb.Entity) error { names[e.ID()] = append(names[e.ID()], p) return nil - }, -1) + }, 1) var beforeCont, sinceCont *Container if before != "" {