git-annex/Command
Joey Hess 16d7432a2f
prevent deadlock when reconcileStaged runs restagePointerFiles
Fix hang that could occur when using git-annex adjust on a branch with a
number of files greater than annex.queuesize. Or potentially other
commands.

When reconcileStaged is running, the database is being opened. But
restagePointerFiles closes the database, and later writes to it. So it will
deadlock if called by reconcileStaged.

The deadlock occurred when the git queue happened to be full, causing
adding a call to restagePointerFiles to it to flush the queue and
restagePointerFiles to run at the wrong time.

Fixed by making reconcileStaged, when it populates or depopulates a pointer
file, arrange for restagePointerFiles to be run as a cleanup action, rather
than from the git queue.

But, what if restagePointerFiles is already in the git queue before
reconcileStaged is run? If it adds anything else to the git queue, causing
the queue to flush, it would still deadlock. To avoid this hypothetical
situation, added a Annex.inreconcilestaged, and made restagePointerFiles
check it and not do anything.

Note that, I did consider the simpler approach of only running
restagePointerFiles as a cleanup action, rather than from the git queue.
But see commit 6a3bd283b8 for why it was made
to use the queue in the first place. I wanted to avoid tying this bug fix
to a behavior change.

Sponsored-by: mycroft
2025-09-22 14:56:50 -04:00
..
Add.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
AddComputed.hs --json for addcomputed and recompute 2025-03-17 15:51:43 -04:00
AddUnused.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
AddUrl.hs remove youtube-dl support, always use yt-dlp 2025-08-27 09:29:43 -04:00
Adjust.hs remove git version check for adjusted branch 2025-08-21 11:12:36 -04:00
Assist.hs more OsPath conversion (650/749) 2025-02-07 17:03:31 -04:00
Assistant.hs more OsPath conversion (749/749) 2025-02-10 14:59:20 -04:00
Benchmark.hs improve benchmark --databases 2019-11-21 17:25:20 -04:00
CalcKey.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
CheckPresentKey.hs fix --from overriding annex-ignore 2023-11-30 15:12:07 -04:00
Config.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
ConfigList.hs remove dead nodes when loading the cluster log 2024-06-16 14:39:44 -04:00
ConfigRemote.hs configremote: Support --json and --json-error-messages 2023-05-10 14:21:42 -04:00
ContentLocation.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
Copy.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
Dead.hs Tab completion of many commands like info and trust now includes remotes 2024-06-30 12:39:18 -04:00
Describe.hs Tab completion of many commands like info and trust now includes remotes 2024-06-30 12:39:18 -04:00
DiffDriver.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
Direct.hs Automatically convert direct mode repositories to v7 with adjusted unlocked branches 2019-08-26 15:05:25 -04:00
Drop.hs drop: --fast support when dropping from a remote 2025-08-29 12:45:33 -04:00
DropKey.hs plumb in LiveUpdate (WIP) 2024-08-23 16:35:12 -04:00
DropUnused.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
EnableRemote.hs enableremote: Disallow using type= to attempt to change the type of an existing remote 2025-09-22 10:54:16 -04:00
EnableTor.hs p2p --enable 2025-07-30 14:08:59 -04:00
ExamineKey.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
Expire.hs newtype MapLog 2023-11-13 14:37:22 -04:00
Export.hs factor out Annex.GitShaKey 2025-03-03 11:09:28 -04:00
ExtendCluster.hs use annex+http for accessing proxies 2024-07-25 12:00:57 -04:00
FilterBranch.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
FilterProcess.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
Find.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
FindComputed.hs findcompute --inputs 2025-03-19 15:39:05 -04:00
FindKeys.hs add startAction parameter for KeySha 2023-12-06 13:28:02 -04:00
FindRef.hs remove --backend from global options 2022-06-29 13:33:25 -04:00
Fix.hs more OsPath conversion (602/749) 2025-02-07 14:46:11 -04:00
Forget.hs filter out control characters in all other Messages 2023-04-11 12:58:01 -04:00
FromKey.hs more OsPath conversion (602/749) 2025-02-07 14:46:11 -04:00
Fsck.hs fsck: Fix location of annexed files when run in linked worktrees 2025-07-15 13:09:45 -04:00
FuzzTest.hs convert all readFile, writeFile, and appendFile to close-on-exec safe versions 2025-09-05 15:44:32 -04:00
GCryptSetup.hs eliminate s2w8 and w82s 2023-10-26 13:12:57 -04:00
Get.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
Group.hs Tab completion of many commands like info and trust now includes remotes 2024-06-30 12:39:18 -04:00
GroupWanted.hs git style quoting for ActionItemOther 2023-04-08 16:30:01 -04:00
Help.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Import.hs more OsPath conversion (650/749) 2025-02-07 17:03:31 -04:00
ImportFeed.hs open feed file with close-on-exec bit set 2025-09-05 16:02:17 -04:00
InAnnex.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Indirect.hs Automatically convert direct mode repositories to v7 with adjusted unlocked branches 2019-08-26 15:05:25 -04:00
Info.hs info: Added --show option 2025-08-13 16:49:21 -04:00
Init.hs remove dead nodes when loading the cluster log 2024-06-16 14:39:44 -04:00
InitCluster.hs broke out initcluster 2024-06-14 17:23:11 -04:00
InitRemote.hs git-remote-annex: Display full url when using remote with the shorthand url 2024-05-24 17:15:31 -04:00
Inprogress.hs more OsPath conversion (602/749) 2025-02-07 14:46:11 -04:00
List.hs more OsPath conversion (602/749) 2025-02-07 14:46:11 -04:00
Lock.hs more OsPath conversion (602/749) 2025-02-07 14:46:11 -04:00
Log.hs more OsPath conversion (602/749) 2025-02-07 14:46:11 -04:00
LookupKey.hs more OsPath conversion (602/749) 2025-02-07 14:46:11 -04:00
Map.hs convert all readFile, writeFile, and appendFile to close-on-exec safe versions 2025-09-05 15:44:32 -04:00
MatchExpression.hs more OsPath conversion (602/749) 2025-02-07 14:46:11 -04:00
MaxSize.hs use live reposizes in balanced preferred content 2024-08-27 10:17:43 -04:00
Merge.hs sync: When in an adjusted branch, merge changes from the original branch 2023-07-06 12:42:24 -04:00
MetaData.hs more OsPath conversion (602/749) 2025-02-07 14:46:11 -04:00
Migrate.hs migrate: Fix --remove-size to work when a file is not present 2025-04-01 10:47:31 -04:00
MinCopies.hs git style quoting for ActionItemOther 2023-04-08 16:30:01 -04:00
Mirror.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
Move.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
Multicast.hs remove unused adjustedBranchRefresh associated file parameter 2025-02-21 14:51:02 -04:00
NotifyChanges.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
NumCopies.hs git style quoting for ActionItemOther 2023-04-08 16:30:01 -04:00
OldKeys.hs oldkeys: check associated files by default and add --unchecked 2023-08-23 13:46:41 -04:00
P2P.hs p2p --enable 2025-07-30 14:08:59 -04:00
P2PHttp.hs fix build with OsPath build flag 2025-07-21 12:26:45 -04:00
P2PStdIO.hs clean up protocol version for proxying 2024-07-26 13:49:05 -04:00
PostReceive.hs more OsPath conversion (650/749) 2025-02-07 17:03:31 -04:00
PreCommit.hs prevent deadlock when reconcileStaged runs restagePointerFiles 2025-09-22 14:56:50 -04:00
Proxy.hs Automatically convert direct mode repositories to v7 with adjusted unlocked branches 2019-08-26 15:05:25 -04:00
Pull.hs git-annex pull and push 2023-05-16 16:51:07 -04:00
Push.hs git-annex pull and push 2023-05-16 16:51:07 -04:00
ReadPresentKey.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Recompute.hs --json for addcomputed and recompute 2025-03-17 15:51:43 -04:00
RecvKey.hs remove unused adjustedBranchRefresh associated file parameter 2025-02-21 14:51:02 -04:00
RegisterUrl.hs plumb in LiveUpdate (WIP) 2024-08-23 16:35:12 -04:00
Reinit.hs remove dead nodes when loading the cluster log 2024-06-16 14:39:44 -04:00
Reinject.hs remove unused adjustedBranchRefresh associated file parameter 2025-02-21 14:51:02 -04:00
ReKey.hs remove unused adjustedBranchRefresh associated file parameter 2025-02-21 14:51:02 -04:00
RemoteDaemon.hs audit all openFd and dupping for close-on-exec 2025-09-04 16:01:41 -04:00
RenameRemote.hs renameremote: Support --json and --json-error-messages 2023-05-08 16:25:40 -04:00
Repair.hs more OsPath conversion (572/749) 2025-02-06 16:18:52 -04:00
Required.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
ReregisterUrl.hs add reregisterurl command 2024-03-05 15:06:14 -04:00
ResolveMerge.hs more OsPath conversion (572/749) 2025-02-06 16:18:52 -04:00
Restage.hs restage: New git-annex command, handles restaging unlocked files 2022-09-23 16:29:59 -04:00
RmUrl.hs more OsPath conversion (572/749) 2025-02-06 16:18:52 -04:00
Satisfy.hs added git-annex satisfy 2023-06-29 15:34:53 -04:00
Schedule.hs filter out control characters and quote filenames 2023-04-11 14:27:22 -04:00
Semitrust.hs Tab completion of many commands like info and trust now includes remotes 2024-06-30 12:39:18 -04:00
SendKey.hs more OsPath conversion (572/749) 2025-02-06 16:18:52 -04:00
SetKey.hs remove unused adjustedBranchRefresh associated file parameter 2025-02-21 14:51:02 -04:00
SetPresentKey.hs plumb in LiveUpdate (WIP) 2024-08-23 16:35:12 -04:00
Sim.hs convert all readFile, writeFile, and appendFile to close-on-exec safe versions 2025-09-05 15:44:32 -04:00
Smudge.hs prevent deadlock when reconcileStaged runs restagePointerFiles 2025-09-22 14:56:50 -04:00
Status.hs more OsPath conversion (572/749) 2025-02-06 16:18:52 -04:00
Sync.hs sync: push current branch first 2025-06-04 12:06:00 -04:00
Test.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
TestRemote.hs remove unused adjustedBranchRefresh associated file parameter 2025-02-21 14:51:02 -04:00
TransferKey.hs remove unused adjustedBranchRefresh associated file parameter 2025-02-21 14:51:02 -04:00
TransferKeys.hs remove unused adjustedBranchRefresh associated file parameter 2025-02-21 14:51:02 -04:00
Transferrer.hs remove unused adjustedBranchRefresh associated file parameter 2025-02-21 14:51:02 -04:00
Trust.hs Tab completion of many commands like info and trust now includes remotes 2024-06-30 12:39:18 -04:00
Unannex.hs more OsPath conversion (542/749) 2025-02-06 11:38:14 -04:00
Undo.hs more OsPath conversion (542/749) 2025-02-06 11:38:14 -04:00
Ungroup.hs Tab completion of many commands like info and trust now includes remotes 2024-06-30 12:39:18 -04:00
Uninit.hs more OsPath conversion (542/749) 2025-02-06 11:38:14 -04:00
Unlock.hs prevent deadlock when reconcileStaged runs restagePointerFiles 2025-09-22 14:56:50 -04:00
UnregisterUrl.hs restore old registerurl location tracking behavior 2023-04-05 17:06:44 -04:00
Untrust.hs Tab completion of many commands like info and trust now includes remotes 2024-06-30 12:39:18 -04:00
Unused.hs more OsPath conversion (542/749) 2025-02-06 11:38:14 -04:00
UpdateCluster.hs deal with NoUUID in checkCanProxy 2025-03-21 12:29:44 -04:00
UpdateProxy.hs deal with NoUUID in checkCanProxy 2025-03-21 12:29:44 -04:00
Upgrade.hs remove dead nodes when loading the cluster log 2024-06-16 14:39:44 -04:00
VAdd.hs filter out control characters in all other Messages 2023-04-11 12:58:01 -04:00
VCycle.hs filter out control characters in all other Messages 2023-04-11 12:58:01 -04:00
Version.hs version: Avoid error message when entire output is not read 2023-05-19 15:00:57 -04:00
VFilter.hs understand adjusted view branch names 2023-02-27 14:57:58 -04:00
Vicfg.hs convert all readFile, writeFile, and appendFile to close-on-exec safe versions 2025-09-05 15:44:32 -04:00
View.hs more OsPath conversion (542/749) 2025-02-06 11:38:14 -04:00
VPop.hs vpop: Only update state after successful checkout 2024-11-11 14:15:51 -04:00
Wanted.hs improve usage 2024-08-11 14:37:18 -04:00
Watch.hs webapp: Added --port option, and annex.port config 2024-01-25 14:08:36 -04:00
WebApp.hs convert all readFile, writeFile, and appendFile to close-on-exec safe versions 2025-09-05 15:44:32 -04:00
Whereis.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
WhereUsed.hs whereused: Fix bug that could find matches from grafts in remote git-annex branches 2025-05-05 14:32:25 -04:00