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 let Remote.availability return Unavilable 2023-08-16 14:31:31 -04:00
Backend.hs more OsPath conversion 2025-01-29 11:53:20 -04:00
Benchmark.hs benchmark: Add --databases to benchmark sqlite databases 2019-10-29 16:59:27 -04:00
BranchState.hs more OsPath conversion 2025-01-27 16:55:07 -04:00
CatFileHandles.hs separate handles for cat-file and cat-file --batch-check 2021-09-24 13:16:13 -04:00
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 have setConcurrency stop any running git coprocesses 2021-11-19 12:00:39 -04:00
Creds.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
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 remove --backend from global options 2022-06-29 13:33:25 -04:00
DesktopNotify.hs remove many old version ifdefs 2019-07-05 15:09:37 -04:00
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 cache annex index filename for 1.5% speedup to queries 2020-04-10 13:37:04 -04:00
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 prep for fixing find --branch --unlocked 2021-03-02 13:39:31 -04:00
LockCache.hs more OsPath conversion 2025-01-30 15:46:32 -04:00
Messages.hs rename errorid to message-id 2023-04-26 12:53:30 -04:00
MetaData.hs sim: Add metadata command 2024-09-26 12:20:37 -04:00
Mime.hs Added mimeencoding= term to annex.largefiles expressions. 2019-04-30 12:17:22 -04:00
NumCopies.hs git-annex sim command is working 2024-09-12 16:10:52 -04:00
ProposedAccepted.hs separate RemoteConfig parsing basically working 2020-01-14 12:35:08 -04:00
RefSpec.hs Typo: sansative -> sensitive 2023-03-17 15:14:50 -04:00
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 improve comment 2020-01-06 12:53:09 -04:00
RepoSize.hs sim: Fix size tracking for balanced preferred content 2024-09-23 12:42:32 -04:00
RepoVersion.hs v7 2018-10-25 18:24:23 -04:00
ScheduledActivity.hs avoid using MonadFail in ParseDuration 2020-08-15 15:53:35 -04:00
StallDetection.hs run codespell throughout fixing typos automagically 2024-05-01 15:46:21 -04:00
StandardGroups.hs a few forgotten remote config fields 2020-01-15 11:22:36 -04:00
StoreRetrieve.hs more OsPath conversion 2025-02-01 14:06:38 -04:00
Test.hs test: Add --test-debug option 2022-11-28 15:12:53 -04:00
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 propagate signals to the transferrer process group 2020-12-11 15:32:00 -04:00
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 split upgrade into v9 and v10 2022-01-19 13:09:33 -04:00
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 deal better with clock skew situations, using vector clocks 2021-08-04 12:33:46 -04:00
View.hs add directory to views for files that lack specified metadata 2023-02-07 16:28:46 -04:00
WorkerPool.hs improve concurrency of move/copy --from --to 2023-01-24 13:59:39 -04:00