git-annex/Types
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
..
ActionItem.hs more OsPath conversion 2025-01-28 15:46:00 -04:00
AdjustedBranch.hs better name for LinkPresentAdjustment 2024-10-21 15:42:01 -04:00
Availability.hs
Backend.hs more OsPath conversion 2025-01-29 11:53:20 -04:00
Benchmark.hs
BranchState.hs more OsPath conversion 2025-01-27 16:55:07 -04:00
CatFileHandles.hs
CleanupActions.hs prevent deadlock when reconcileStaged runs restagePointerFiles 2025-09-22 14:56:50 -04:00
Cluster.hs remove dead nodes when loading the cluster log 2024-06-16 14:39:44 -04:00
Command.hs git-annex-shell: accept uuid of remote that proxying is enabled for 2024-06-10 12:44:35 -04:00
Concurrency.hs
Creds.hs
Crypto.hs Don't allow the type of encryption of an existing special remote to be changed. 2025-08-21 13:41:00 -04:00
DeferredParse.hs
DesktopNotify.hs
Difference.hs implemented cloneSimRepo 2024-09-06 14:23:29 -04:00
Direction.hs more OsPath conversion 2025-02-01 11:54:19 -04:00
Distribution.hs convert from readFileStrict 2025-01-22 16:20:36 -04:00
Export.hs OsPath conversion 2025-01-25 11:53:47 -04:00
FileMatcher.hs more OsPath conversion (520/749) 2025-02-05 15:07:59 -04:00
GitConfig.hs annex.assistant.allowunlocked 2025-09-16 14:58:26 -04:00
GitRemoteAnnex.hs avoid duplicates building up in outManifest 2024-05-24 15:10:56 -04:00
Group.hs git-annex sim command is working 2024-09-12 16:10:52 -04:00
Import.hs more OsPath conversion (650/749) 2025-02-07 17:03:31 -04:00
IndexFiles.hs
Key.hs more OsPath conversion 2025-01-28 15:46:00 -04:00
KeySource.hs more OsPath conversion 2025-01-29 11:53:20 -04:00
Link.hs
LockCache.hs more OsPath conversion 2025-01-30 15:46:32 -04:00
Messages.hs
MetaData.hs sim: Add metadata command 2024-09-26 12:20:37 -04:00
Mime.hs
NumCopies.hs git-annex sim command is working 2024-09-12 16:10:52 -04:00
ProposedAccepted.hs
RefSpec.hs
Remote.hs improve comment 2025-04-11 11:17:09 -04:00
RemoteConfig.hs git-remote-annex: Display full url when using remote with the shorthand url 2024-05-24 17:15:31 -04:00
RemoteState.hs
RepoSize.hs sim: Fix size tracking for balanced preferred content 2024-09-23 12:42:32 -04:00
RepoVersion.hs
ScheduledActivity.hs
StallDetection.hs
StandardGroups.hs
StoreRetrieve.hs more OsPath conversion 2025-02-01 14:06:38 -04:00
Test.hs
Transfer.hs more OsPath conversion 2025-01-28 15:46:00 -04:00
Transferrer.hs more OsPath conversion 2025-01-28 16:31:19 -04:00
TransferrerPool.hs
Transitions.hs more OsPath conversion 2025-02-01 11:54:19 -04:00
TrustLevel.hs git-annex sim command is working 2024-09-12 16:10:52 -04:00
Upgrade.hs
UrlContents.hs more OsPath conversion 2025-02-04 16:09:47 -04:00
UUID.hs more OsPath conversion (602/749) 2025-02-07 14:46:11 -04:00
VectorClock.hs
View.hs
WorkerPool.hs