move cache cleanup to avoid a race
authorJoey Hess <joeyh@joeyh.name>
Mon, 5 Oct 2020 18:07:27 +0000 (14:07 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 5 Oct 2020 18:07:27 +0000 (14:07 -0400)
commit12a248f823fe6e278ed3336fa6834958b1f8e321
tree544f6987dd4ad7b92abbeb383f7e19f6d48eca30
parentf0ec725234463a7165a4339c8a65486a9b04ab3a
move cache cleanup to avoid a race

This should fix doc/bugs/standalone_runshell_can_race_and_fail_to_remove___96____126____47__.cache__47__git-annex__47__locales__47____96___dirs
where 2 runshells were running and the second one tried to clean up
LOCPATH while the first one was still populating it.

By moving the cleanup until after LOCPATH is populated, we guarantee
it's populated, so don't need to worry about such a race with another
process populating our same LOCPATH.
standalone/linux/skel/runshell