Fix/datalad cache #199
No reviewers
Labels
No labels
CRITICAL
Stale
WIP
bug
concept
coordinate
dataset
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
maintenance
maps
marker
mask
on hold
parcellation
preprocess
question
ready
storage
template-space
triage
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
juaml/junifer!199
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/datalad_cache"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fix an issue with datalad cache/locks on independent clones (temporary directories)
The main issue is a scalability issue and the cache/locks set in the home folder. At some point, there are way too many processes looking to get the lock, and even with the retries and waiting periods, they just give up and start failing.
Solution: use os.environ["DATALAD_LOCATIONS_LOCKS"] = ... to set an override (so each process has an independent lock/cache) and then datalad.cfg.reload() to force reload the configuration. This is supposed to propagate the override to subproccesses.
Also, this PR allows to use numbers for verbosity levels.
Codecov Report
100.00% <ø> (ø)93.48% <55.55%> (-0.30%)Flags with carried forward coverage won't be shown. Click here to find out more.
69.47% <41.17%> (-6.43%)90.55% <80.00%> (-1.19%)@ -74,6 +74,45 @@ def _parse_elements(element: str, config: Dict) -> Union[List, None]:return elementsMissing return type annotation.
We can also not have the
elsehere as we have early returns for the previous cases.I wouldn't go with a
passas it might have unforeseen cases. Better to log it or warn?@ -160,6 +160,49 @@ def test_datalad_clone_cleanup(assert len(list(datadir.glob("*"))) == 0def test_datalad_clone_create_cleanup(concrete_datagrabber: Type) -> None:Maybe have the type as the base class for datalad stuff?
@ -74,6 +74,45 @@ def _parse_elements(element: str, config: Dict) -> Union[List, None]:return elementsIt's just an invalid string value that is not a valid option and can't be casted to int. We need to continue and then raise the BadParameter. There's no reason to log/warn here. It's a dead-end.
@ -74,6 +74,45 @@ def _parse_elements(element: str, config: Dict) -> Union[List, None]:return elementsI would put the
returnin anelseblock then and put a comment so that we know why it's like that.@ -74,6 +74,45 @@ def _parse_elements(element: str, config: Dict) -> Union[List, None]:return elementsI'll add the comment, but I do not like the
elseblock to contain just the return as it complicates reading.@ -74,6 +74,45 @@ def _parse_elements(element: str, config: Dict) -> Union[List, None]:return elementsFair enough. It's how Python docs explain one to write it which makes sense to me.
@ -160,6 +160,49 @@ def test_datalad_clone_cleanup(assert len(list(datadir.glob("*"))) == 0def test_datalad_clone_create_cleanup(concrete_datagrabber: Type) -> None:I don't get it. This is a copy/paste from the other tests
@ -160,6 +160,49 @@ def test_datalad_clone_cleanup(assert len(list(datadir.glob("*"))) == 0def test_datalad_clone_create_cleanup(concrete_datagrabber: Type) -> None:Ah yes I remember why it's like that. My bad, you can keep it like that.