10 Commits

Author SHA1 Message Date
Jonathan A. Sternberg
799749a8fb fix: remove data race in the progress writer
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2026-04-14 15:05:50 -05:00
Tonis Tiigi
f6c142ec23 lint: update some sorting code to newer generics based libs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-03-20 10:32:02 -07:00
Tonis Tiigi
b5286f8dcb apply x/tools/modernize fixes
Autogenerated with couple of manual patches.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-03-07 08:18:45 -08:00
Tonis Tiigi
dfc35271ae simplify with maps pkg functions
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-06-12 18:33:30 -07:00
Justin Chadwell
7aee2929ee progress: add panic for multiwriter cycles
Previously, if this case occured, we would deadlock, so as to make this
case more easily identifiable and debuggable, we should panic instead.
Potentially, we could also just *skip* this case, but given that this is
an internal logical error that should not occur, it would be better to
identify this.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2024-01-17 14:14:40 +00:00
Tonis Tiigi
e1da8b7f82 solver: fix printing progress messages after merged edges
When different LLB vertexes (eg. parallel requests referencing
local sources from different sessions) generate same cache keys
during solve they are merged together into a single operation.

Currently, when this happened the progress for the vertex that
was dropped got lost. This fixes this case by adding the
progressWriter of the redirected vertex as a target to the
source one.

This should also work with multiple levels of merged edges,
just multiple nested multiwriters as well.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2023-10-23 15:02:53 -07:00
Jonathan A. Sternberg
4c83fcf365 Avoid unnecessary map allocation when writing progress
`MultiWriter` would create an unnecessary map allocation when the
`Write` method was used. The `Write` method would create a progress
object with the meta field initialized to the meta field of the writer
itself. It then invoked its own `WriteRawProgress` method which would
see two maps with the metadata and erroneously believe that they were
different and needed to be merged into a single metadata map.

Since this map is initialized with the metadata of the writer before
`WriteRawProgress` is invoked, this merge was unnecessary and could add
a lot of unnecessary memory allocations during a build.

This changes the `MultiWriter.Write` method to invoke the private
`writeRawProgress` which performs the actual write and avoids the
metadata merge.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2023-08-07 17:00:48 -05:00
David Gageot
1245e43085 Enable gosimple linter
Signed-off-by: David Gageot <david.gageot@doctolib.com>
2022-04-23 23:57:16 +02:00
Tonis Tiigi
57a88b0afb lint: add misspell and unused
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-18 08:13:57 -07:00
Tonis Tiigi
01aaf130e5 solver: refactor to a shared vertex solver model
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-09-18 13:58:33 -07:00