From 7e35c81ada471ea03f05b0de671fd4bf6f0e657c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 7 Mar 2019 15:22:23 -0400 Subject: [PATCH] locking problem --- doc/todo/import_tree.mdwn | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/todo/import_tree.mdwn b/doc/todo/import_tree.mdwn index 32b2f91dc5..1bc9f44df5 100644 --- a/doc/todo/import_tree.mdwn +++ b/doc/todo/import_tree.mdwn @@ -10,6 +10,24 @@ this. ## implementation notes +* updateExportTreeFromLog deadlocks when running git-annex export because + it locks the export db first. + + Could switch to fine-grained locking, but Command.Export would need to + lock and flush writes to the database many times, and that may be too + expensive. + + How about this: Make an action that waits to lock the export db and + runs updateExportTreeFromLog. While the update is running take an + exclusive lock on an update lock file. Only lock the database using that, + in Command.Export etc. + + Then, in ExportImport, it only has to try to run that action; + if the action fails due to the lock being held by the same or another + process, it suffices to take a shared lock of the update lock file + (and immediately release it), in order to wait for the update to + complete. + * Need to support annex-tracking-branch configuration, which documentation says makes git-annex sync and assistant do imports.