From 71043fe9f77f4c481449e83998d8cf34da4b4a94 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 12 Aug 2024 10:01:48 -0400 Subject: [PATCH] update --- ...ck_free_space_in_repos_via_git-annex_branch.mdwn | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/todo/track_free_space_in_repos_via_git-annex_branch.mdwn b/doc/todo/track_free_space_in_repos_via_git-annex_branch.mdwn index ad499e377d..760a6de331 100644 --- a/doc/todo/track_free_space_in_repos_via_git-annex_branch.mdwn +++ b/doc/todo/track_free_space_in_repos_via_git-annex_branch.mdwn @@ -92,4 +92,17 @@ merge time. Those are less expensive than diffing the location logs only because the logs they diff are less often used, and the work is only done when relevant commands are run. +## concurrency + +Suppose a repository is almost full. Two concurrent threads or processes +are considering sending two different keys to the repository. It can hold +either key, but not both. So the size tracking seems to need to be +provisionally updated for one key before it is sent, and then the check for +the other key will show not enough space and it won't be sent. If the first +key fails to get sent, the size needs to be reset back. + +Note that checkDiskSpace deals with this by looking at +sizeOfDownloadsInProgress. It would be possible to make a +`sizeOfUploadsInProgressToRemote r` similarly. + [[!tag projects/openneuro]]