mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-01 23:08:43 +01:00
Fix memory leak in Index.build_graph()
`@memoize()` memory lives as long as decorated function lives, which is permanent in this case. Since `self` is referenced as a memory key no `Index` will ever be freed. Changed to use `@cached_property` whose cache lives as long as the parent instance.
This commit is contained in:
committed by
Ruslan Kuprieiev
parent
0e0e1725e6
commit
9ee428ef17
@@ -77,7 +77,9 @@ def test_locked(mocker):
|
||||
|
||||
def test_skip_graph_checks(tmp_dir, dvc, mocker, run_copy):
|
||||
# See https://github.com/iterative/dvc/issues/2671 for more info
|
||||
mock_build_graph = mocker.patch("dvc.repo.index.Index.build_graph")
|
||||
from dvc.repo.index import Index
|
||||
|
||||
mock_build_graph = mocker.spy(Index.graph, "fget")
|
||||
|
||||
# sanity check
|
||||
tmp_dir.gen("foo", "foo text")
|
||||
|
||||
Reference in New Issue
Block a user