buildkit/client
Erik Sipsma 3b418db323 llb: Cache DefinitionOp inputs to support memoization during Marshal
llb.State.Marshal uses a vertexCache map (keyed by the llb.Vertex interface
value) to memoize which vertexes it has already visited while marshalling.

However, before this change, llb.DefinitionOp was constructing new pointers for
each value in the return slice of Inputs(), which meant that each input had a
different key in the vertexCache (due to being different pointer values). This
meant no memoization actually occured. I noticed this while using
llb.DefinitionOp with a fairly large graph when my program crashed after using
>16GB of RSS during a call to llb.State.Marshal.

The fix here avoids changing vertexCache as that would impact many other
vertex implementations. Instead, just DefinitionOp.Inputs() is updated to cache
the pointers it creates and pass that cache to its descendents. This fix
resulted in the program that was previously crashing out-of-memory to run
without any perceivable increase in RSS.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2020-08-10 17:23:04 -07:00
..
buildid allow frontends to be run directly on the control client side 2018-08-14 11:50:08 +01:00
connhelper new connection helper: podman-container://<CONTAINER> 2020-08-06 15:38:16 +09:00
llb llb: Cache DefinitionOp inputs to support memoization during Marshal 2020-08-10 17:23:04 -07:00
ociindex replace gometalinter with golangci linter 2020-07-18 08:13:48 -07:00
build.go Revert "grpc: add error handling wrappers to client/server" 2020-04-22 18:31:27 -07:00
build_test.go llb: asyncronous llb graph generation support 2020-04-03 14:55:10 -07:00
client.go setting host part of address as :authority pseudo header. 2020-07-31 21:10:45 +09:00
client_test.go Add support for lazily-pulled blobs in cache manager. 2020-08-05 17:18:43 -07:00
client_unix.go client: update dialer to contextDialer 2020-07-19 09:28:36 -07:00
client_windows.go client: update dialer to contextDialer 2020-07-19 09:28:36 -07:00
diskusage.go cache: detect refs shared with image store 2018-07-27 14:08:50 -07:00
exporters.go exporter: add tar exporter 2019-03-27 09:40:24 -07:00
filter.go client: generalize the filter passing 2018-07-25 18:19:31 -07:00
graph.go support local cache exporter and importer 2019-01-19 02:38:26 +09:00
prune.go cache: add gc style pruning support 2018-08-06 21:45:39 -07:00
solve.go Set single export entry outside of session initialization 2020-04-08 14:07:35 -07:00
workers.go update golint comments 2018-09-18 22:06:47 -07:00