Commit Graph

15 Commits

Author SHA1 Message Date
Tonis Tiigi
7fc428cdfc solver: release unreferenced cache keys after gc
Previously this routine only ran after user ran
prune command or on reboot of the daemon.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-11-20 22:49:54 -08:00
Tonis Tiigi
1958ae229a solver: fix possible panic from error handler
If error is returned from `Save()`, `rck` is nil and
causes nil dereference panic on accessing `TraceFields` when
printing debug logs.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-09-13 15:19:33 -07:00
Justin Chadwell
62205f47a3 chore: tidy up removal of digest algorithm
In these cases, we can just call digest.Encoded(), instead of needing to
play around with removing the prefix.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-12-05 18:05:32 +00:00
Alex Couture-Beil
9a8bd9fde8 solver: protect against nil rres upon errors
Signed-off-by: Alex Couture-Beil <alex@mofo.ca>
2023-10-13 12:54:18 -07:00
Erik Sipsma
45b19d34ef Improve cache related trace logging.
This adds trace logs to the solver's cache manager to assist debugging
cache misses+hits.

It also replace the LazyStackTrace struct with a function that returns a
stack trace string only if trace level is enabled, an empty string
otherwise. This makes it easier to use with logrus hooks that pass the
fields around to different goroutines without needing to try to "unlazy"
the fields first.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2023-08-07 07:25:40 -07:00
Erik Sipsma
14b0e9d8f8 solver: Release unused refs in LoadWithParents
Before this any refs that were loaded but not put into results would be
leaked.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2023-04-24 17:51:36 -07:00
Kohei Tokunaga
085bd8af7f Fix cache cannot reuse lazy layers
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2023-01-24 16:23:56 +09:00
Morlay
18b49fd7dc refactor to use util/bklog instead of using logurs directly
Signed-off-by: Morlay <morlay.null@gmail.com>
2021-07-13 11:42:31 +08:00
Tonis Tiigi
cfabf3009b solver: avoid looping over same keys in loadwithparents
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-03-18 17:07:57 -07:00
Tonis Tiigi
5be7870549 load parent results on combined cachemanager
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-01-21 19:39:15 -08:00
Tonis Tiigi
ac4037a1d9 solver: keep original cache creation date when copying between stores
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-01-18 11:19:34 -08:00
Tonis Tiigi
1ec543e384 solver: exclude randomized cache keys from exporter
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-01-18 11:19:25 -08:00
Tonis Tiigi
0940cdc6fe update golint comments
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-18 22:06:47 -07:00
Tonis Tiigi
a7fedd9c9f control: clean up cache metadata after prune
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-23 16:27:01 -07:00
Tonis Tiigi
71f5e6dd21 solver: rename solver-next to solver
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-05-14 09:53:34 -07:00