Commit graph

41296 commits

Author SHA1 Message Date
Joey Hess
b060d99fe0
comment 2021-12-08 13:18:13 -04:00
Joey Hess
b8f4f2fb89
comment 2021-12-08 12:47:34 -04:00
jasonb@ab4484d9961a46440958fa1a528e0fc435599057
d45e4ea685 Added a comment 2021-12-08 16:25:32 +00:00
jasonb@ab4484d9961a46440958fa1a528e0fc435599057
2eeb379e4d Added a comment 2021-12-08 00:46:40 +00:00
yarikoptic
2719170575 initial todo on more flexible credentials management mechanism 2021-12-07 18:34:58 +00:00
Joey Hess
a7a5915cda
comment 2021-12-07 13:03:45 -04:00
Joey Hess
af236a7c6f
Merge branch 'master' of ssh://git-annex.branchable.com 2021-12-07 13:00:47 -04:00
Joey Hess
58460ac3e4
comment 2021-12-07 13:00:28 -04:00
jasonb@ab4484d9961a46440958fa1a528e0fc435599057
e2c7a130ec 2021-12-07 03:32:41 +00:00
Joey Hess
756768a6a4
fixed 2021-12-06 15:44:14 -04:00
Joey Hess
d4665731d9
remove last trailing unresolved bit
I think the lock file probing stuff is ok as it is for pid locks.
If not, let's wait until we have a test case, it would be easy to subtly
break it.
2021-12-06 15:34:56 -04:00
Joey Hess
a91c4d945e
comment 2021-12-06 15:13:54 -04:00
Joey Hess
ef3ab0769e
close pid lock only once no threads use it
This fixes a FD leak when annex.pidlock is set and -J is used. Also, it
fixes bugs where the pid lock file got deleted because one thread was
done with it, while another thread was still holding it open.

The LockPool now has two distinct types of resources,
one is per-LockHandle and is used for file Handles, which get closed
when the associated LockHandle is closed. The other one is per lock
file, and gets closed when no more LockHandles use that lock file,
including other shared locks of the same file.

That latter kind is used for the pid lock file, so it's opened by the
first thread to use a lock, and closed when the last thread closes a lock.

In practice, this means that eg git-annex get of several files opens and
closes the pidlock file a few times per file. While with -J5 it will open
the pidlock file, process a number of files, until all the threads happen to
finish together, at which point the pidlock file gets closed, and then
that repeats. So in either case, another process still gets a chance to
take the pidlock.

registerPostRelease has a rather intricate dance, there are fine-grained
STM locks, a STM lock of the pidfile itself, and the actual pidlock file
on disk that are all resolved in stages by it.

Sponsored-by: Dartmouth College's Datalad project
2021-12-06 15:01:39 -04:00
Joey Hess
774c7dab2f
Merge branch 'master' into pidlockfinegrained 2021-12-06 13:00:40 -04:00
Joey Hess
7c78fae463
Merge branch 'master' of ssh://git-annex.branchable.com 2021-12-06 12:53:43 -04:00
Joey Hess
ae4c56b28a
Revert "fix too early close of shared lock file"
This reverts commit 66b2536ea0.

I misunderstood commit ac56a5c2a0
and caused a FD leak when pid locking is not used.

A LockHandle contains an action that will close the underlying lock
file, and that action is run when it is closed. In the case of a shared
lock, the lock file is opened once for each LockHandle, and only
the one for the LockHandle that is being closed will be closed.
2021-12-06 12:51:28 -04:00
alt
371238eca3 2021-12-06 15:56:56 +00:00
jasonb@ab4484d9961a46440958fa1a528e0fc435599057
a8ff96864e 2021-12-05 20:37:48 +00:00
Joey Hess
00625caf87
update 2021-12-05 08:11:41 -04:00
Joey Hess
490689f122
Merge branch 'master' of ssh://git-annex.branchable.com 2021-12-03 18:42:05 -04:00
Joey Hess
e464ffd641
update comment to current status 2021-12-03 18:41:51 -04:00
Joey Hess
9d3dce94f0
comment 2021-12-03 18:41:34 -04:00
yarikoptic
8a3b6f46c8 Added a comment 2021-12-03 21:41:53 +00:00
Joey Hess
e5ca67ea1c
fine-grained locking when annex.pidlock is enabled
This locking has been missing from the beginning of annex.pidlock.
It used to be possble, when two threads are doing conflicting things,
for both to run at the same time despite using locking. Seems likely
that nothing actually had a problem, but it was possible, and this
eliminates that possible source of failure.

Sponsored-by: Dartmouth College's Datalad project
2021-12-03 17:20:21 -04:00
Joey Hess
a5fcc03595
comment 2021-12-03 16:40:58 -04:00
Joey Hess
6988c2e740
fix build on windows
broken by ed0afbc36b

Sponsored-by: Dartmouth College's Datalad project
2021-12-03 14:08:12 -04:00
ashton@37fa3fec6d2eef022a3491c85362a34141fbf0db
5d9cc3e5af 2021-12-02 23:36:10 +00:00
yarikoptic
3205686faf Added a comment 2021-12-02 20:42:37 +00:00
yarikoptic
d88a52886d removed 2021-12-02 20:41:37 +00:00
yarikoptic
33c36ef5cb initial follow up on the read-only mode issue 2021-12-02 20:39:39 +00:00
yarikoptic
937b9de516 Added a comment: automate + extend 2021-12-02 20:34:55 +00:00
yarikoptic
9c0f3d1de8 Added a comment 2021-12-02 13:05:55 +00:00
Joey Hess
ed0afbc36b
avoid concurrent threads trying to take pid lock at same time
Seem there are several races that happen when 2 threads run PidLock.tryLock
at the same time. One involves checkSaneLock of the side lock file, which may
be deleted by another process that is dropping the lock, causing checkSaneLock
to fail. And even with the deletion disabled, it can still fail, Probably due
to linkToLock failing when a second thread overwrites the lock file.

The same can happen when 2 processes do, but then one process just fails
to take the lock, which is fine. But with 2 threads, some actions where failing
even though the process as a whole had the pid lock held.

Utility.LockPool.PidLock already maintains a STM lock, and since it uses
LockShared, 2 threads can hold the pidlock at the same time, and when
the first thread drops the lock, it will remain held by the second
thread, and so the pid lock file should not get deleted until the last
thread to hold it drops the lock. Which is the right behavior, and why a
LockShared STM lock is used in the first place.

The problem is that each time it takes the STM lock, it then also calls
PidLock.tryLock. So that was getting called repeatedly and concurrently.

Fixed by noticing when the shared lock is already held, and stop calling
PidLock.tryLock again, just use the pid lock that already exists then.

Also, LockFile.PidLock.tryLock was deleting the pid lock when it failed
to take the lock, which was entirely wrong. It should only drop the side
lock.

Sponsored-by: Dartmouth College's Datalad project
2021-12-01 17:14:39 -04:00
Joey Hess
66b2536ea0
fix too early close of shared lock file
This fixes a reversion introduced in commit
ac56a5c2a0.

I didn't notice there that it was handling the case of a shared lock
file that was still open elsewhere by not running the close action.

This was especially deadly when annex.pidlock is set, as it caused early
deletion of the pid lock file.

Sponsored-by: Dartmouth College's Datalad project
2021-12-01 17:06:28 -04:00
Joey Hess
f50de2455f
retitle 2021-12-01 14:35:31 -04:00
Joey Hess
54a4ca9e3c
comment 2021-12-01 14:10:39 -04:00
Joey Hess
d4e99d902b
analysis 2021-12-01 13:38:47 -04:00
Joey Hess
b7976e08f0
comment 2021-12-01 13:03:05 -04:00
Joey Hess
e11ca04e28
comment 2021-12-01 12:46:07 -04:00
yarikoptic
7ca799efed initial report on needing more thorough retries when downloading from S3 2021-12-01 15:41:13 +00:00
account@dc612ad075297e574ebc3eb9a5b8ab6e753510dc
30c55f8940 Added a comment: Further fix attempts 2021-12-01 03:25:35 +00:00
adina.wagner@2a4cac6443aada2bd2a329b8a33f4a7b87cc8eff
a5b635af20 Added a comment: A few Windows benchmarks 2021-11-29 22:17:39 +00:00
Joey Hess
a6699be79d
catch error statting pid lock file if it somehow does not exist
It ought to exist, since linkToLock has just created it. However,
Lustre seems to have a rather probabilisitic view of the contents of a
directory, so catching the error if it somehow does not exist and
running the same code path that would be ran if linkToLock failed
might avoid this fun Lustre failure.

Sponsored-by: Dartmouth College's Datalad project
2021-11-29 14:53:07 -04:00
Joey Hess
567f63ba47
export: Avoid unncessarily re-exporting non-annexed files that were already exported
Commit b6e4ed9aa7 made non-annexed files
be re-uploaded every time, since they're not tracked in the location log,
and it made it check the location log. Don't do that for non-annexed files.

Sponsored-by: Brock Spratlen on Patreon
2021-11-29 14:02:38 -04:00
Joey Hess
05d79b26d8
clarify 2021-11-29 14:00:32 -04:00
Joey Hess
28cca9b9ff
comment 2021-11-29 13:32:12 -04:00
Joey Hess
357760cacf
comment 2021-11-29 13:16:52 -04:00
Joey Hess
b141b8a009
comment 2021-11-29 13:02:15 -04:00
Joey Hess
01a5ee6998
addurl, youtube-dl: When --check-raw prevents downloading an url, still continue with any downloads that come after it, rather than erroring out
Sponsored-By: Mark Reidenbach on Patreon
2021-11-28 19:40:06 -04:00
Joey Hess
9a1f14e6f0
Merge branch 'master' of ssh://git-annex.branchable.com 2021-11-26 10:32:22 -04:00