Conversation
|
I can confirm that using a new daemon 1.5.0-dev (master) and a 0.6.0 client that this does not work anyways, so +1 to removing |
|
But if anyone else comes here and wonders the client version 0.7.0 works perfectly, its kinda like the coolest thing ever (api version 1.7) |
|
ping @tiborvass @LK4D4 |
|
ping @icecrime |
api/server/server.go
Outdated
There was a problem hiding this comment.
I don't know why, but I prefer to create pointer variable directly here, because config as value isn't used anyway.
|
I'm okay with this. But I should say that for events I moved all filtering to api. So my daemon method just returning events. Maybe we should do same for |
|
I think it depends on who should own filtering. Let's say we have multiple transports, and not just http, would we want to duplicate that logic in each transport/API layer or allow the core daemon to do it in just one spot? If the logic isn't specific to the transport then I tend to want to push it down so its common code and can be reused. |
|
@duglin it can be done by function |
|
I understand that it can be done - its just a question of whether we want to make the caller do it as a second step or make it part of the interface to retrieve the list. If the list is very large I'm sure they would appreciate it being filtered before it got to them. |
|
@duglin I'm not sure why they will appreciate filtering if it is pressure on garbage collector. List size is not an issue here at all. |
daemon/list.go
Outdated
There was a problem hiding this comment.
types.Container is superbig with slices and maps, makes sense to make it []*types.Container.
|
yes - let's not hold up this PR for this bike-shedding conversation but just to explain my thinking.... on IRC you said: also, now without jobs we're creating superbig slice of filtered containers in addition to superbig slice of daemon.container.List() I think its important to separate out our particular implementation choices today from the interfaces. You're correct that right now we create superbig slices of all containers and then filter it down to another superbig slice. But that's because of our choices. If we stored our container info into a DB and applied the filters as we retrieved the list of containers then there's only one superbig slice involved. If we did what you're suggesting, then we'd always return the superbig slice back to the caller not matter what - even if the net result was just 5. In my preferred solution, no slice would ever be larger than 5. And we can get there by introducing a DB and the caller would never know that we've improved - aside from memory consumption/time. In what you're proposing, they would never benefit from the DB switch because they're always going to get superbig results even when the filter brings it down to 5. Doing this on the list of containers isn't probably the best example because the list isn't as large as say events where we could be talking about Gigs of data. The less we move that around the better, so the sooner we can apply the filters the better. And applying it to a DB query, rather than leaving it to the caller, would be more performant, IMO. |
f0cf440 to
5e92284
Compare
daemon/list.go
Outdated
There was a problem hiding this comment.
Ah good catch - removed!
Signed-off-by: Doug Davis <[email protected]>
|
LGTM |
|
good to merge? |
|
I reviewed without reading through all the debates. I dislike the |
There was a problem hiding this comment.
@jfrazelle your test break probably because missing the nil check of var outs here :), anyway it's no need to fix this bug now since the change of this PR.
One step closer to removing engine.Table too :-)
In case people wonder, the code at: https://github.com/docker/docker/compare/master...duglin:RemoveJobPS?expand=1#diff-44a527ea72ea9572e1cf71c7f1e2a0f0L401 appears to be broken based on testing that @jfrazelle and I did. It always return an empty list and in order for that if-statement to even be executed it requires a CLI to use v1.4 API - which is pretty darn old - way way pre-Docker 1.0.0. I think its safe to remove it.
Signed-off-by: Doug Davis [email protected]