Commit graph

37217 commits

Author SHA1 Message Date
yarikoptic
c2f84a76bc Added a comment 2020-06-11 21:13:38 +00:00
Joey Hess
c8ff3e082e
add debug logging wrapper for withCreateProcess 2020-06-11 16:43:24 -04:00
Joey Hess
b60b8ecc78
clarify 2020-06-11 16:20:18 -04:00
Joey Hess
4e778ef849
response 2020-06-11 16:14:17 -04:00
Joey Hess
8a7c615a8f
import: Avoid using some strange names for temporary keys
The ContentIdentifier can contain almost anything, so could have characters
that are not fit for the filesystem, or might be longer than a key usually
is, or contain a newline, or .... genKeyName deals with those problems.

This should not present a back-compat issue, because this is a temporary
key used while downloading the imported file, before the real key for it
can be generated.
2020-06-11 16:07:36 -04:00
Joey Hess
0017d9a347
Merge branch 'master' of ssh://git-annex.branchable.com 2020-06-11 15:44:28 -04:00
Joey Hess
6b0cb2d732
defer cleaning keys db of old data
Avoid creating the keys database during init when there are no unlocked
files, to prevent init failing when sqlite does not work in the filesystem.
2020-06-11 15:40:13 -04:00
Joey Hess
d711dc31fa
response 2020-06-11 14:12:16 -04:00
Joey Hess
e15ab727eb
comment and todo 2020-06-11 14:05:01 -04:00
Joey Hess
2062604327
comment 2020-06-11 13:36:30 -04:00
yarikoptic
646a521473 reporting on a failed unittest on a crippled HOME. 2020-06-11 14:50:37 +00:00
lykos@d125a37d89b1cfac20829f12911656c40cb70018
a0ffdac56e 2020-06-11 11:03:07 +00:00
branchable@bafd175a4b99afd6ed72501042e364ebd3e0c45e
512f77fe2a Added a comment: I've hacked up a Python script for policy-based automatic commits 2020-06-11 10:10:52 +00:00
branchable@bafd175a4b99afd6ed72501042e364ebd3e0c45e
96f2b501a9 Added a comment: I've hacked an ugly daemon together for this 2020-06-11 09:56:57 +00:00
branchable@bafd175a4b99afd6ed72501042e364ebd3e0c45e
b65e596fb8 Added a comment: I wonder if this is related to the use of tor 2020-06-11 09:56:08 +00:00
kanakkshetri@9ea0e7639162bddc7bf9f3bb94cc32e93c793b89
9102d31721 Added a comment: git-annex-repair and git annex fsck: no errors found 2020-06-10 14:39:44 +00:00
kanakkshetri@9ea0e7639162bddc7bf9f3bb94cc32e93c793b89
c4a9647555 noticed confusing two rsync processes to copy one file. 2020-06-10 10:58:05 +00:00
Joey Hess
266ec93237
ugh 2020-06-09 17:39:03 -04:00
Joey Hess
e0d8ab75dd
Merge branch 'master' of ssh://git-annex.branchable.com 2020-06-09 16:20:45 -04:00
Joey Hess
24766125d9
update 2020-06-09 16:20:08 -04:00
Joey Hess
c1b4e79f50
devblog 2020-06-09 16:19:07 -04:00
Joey Hess
8a824147e4
horrible realization 2020-06-09 16:10:27 -04:00
Joey Hess
24ff5e2b29
use uninterruptibleMask
Some recent changes to use mask missed that async exceptions can still
be thrown inside it. The goal is to make sure a block of cleanup code
runs entirely, w/o being interrupted by an async exception, so use
uninterruptibleMask.

Also, converted a few to bracket, which is nicer.
2020-06-09 15:02:56 -04:00
Joey Hess
7013798df5
async exception safety for coprocesses
Tested the forcerestart code path and it works.

The hairy part is, what if an async exception is caught when it's in
restart?

If it's in the part that stops the old process, the old process
is left in the handle. The next attempt to use the CoProcessHandle
will then throw an IO exception, which will result in restart getting
run again. So I think this will work, but have not actually tested it.

The use of withMVarMasked lets it start the new process and fill the
mvar with it, even if there's an async exception at that point.

Note that exceptions are masked while running forcerestart, so
do not need to worry about an async exception being thrown while it's
recovering from an async exception.
2020-06-09 13:44:23 -04:00
Joey Hess
a49d300545
async exception safety for external special remote processes
Since an external process can be in the middle of some operation when an
async exception is received, it has to be shut down then. Using
cleanupProcess will close its IO handles and send it a SIGTERM.

If a special remote choses to catch SIGTERM, it's fine for it to do some
cleanup then, but until it finishes, git-annex will be blocked waiting
for it. If a special remote blocked SIGTERM, it would cause a hang.
Mentioned in docs.

Also, in passing, fixed a FD leak, it was not closing the error handle
when shutting down the external. In practice that didn't matter before because
it was only run when git-annex was itself shutting down, but now that it
can run on exception, it would have been a problem.
2020-06-09 12:22:14 -04:00
kanakkshetri@9ea0e7639162bddc7bf9f3bb94cc32e93c793b89
34b088b209 Output of --debug, Formatting 2020-06-08 15:09:20 +00:00
meribold
52412b773b AWS tells me that the Reduced Redundancy storage class is less cost effective than Standard and not recommended 2020-06-08 14:58:48 +00:00
kanakkshetri@9ea0e7639162bddc7bf9f3bb94cc32e93c793b89
634c66ea49 2020-06-08 14:24:37 +00:00
strmd
2d2a735ce7 2020-06-08 07:11:55 +00:00
yarikoptic
02ee2d0e47 2020-06-07 19:38:34 +00:00
Ilya_Shlyakhter
ebdf27f0a3 added question about building from source using stack 2020-06-06 23:03:44 +00:00
Joey Hess
a294a27f9d
Merge branch 'master' of ssh://git-annex.branchable.com 2020-06-05 19:08:15 -04:00
Joey Hess
3ed797be0f
fix reversion
From back in 4be94c67c7.
Caused the test suite to fail, when bup is installed, but was not
noticed since the autobuilds don't have bup.
2020-06-05 19:06:09 -04:00
yarikoptic
8e3cdfa90e Added a comment 2020-06-05 22:15:09 +00:00
yarikoptic
04aa8360a9 Added a comment: reply to Joey's comments 2020-06-05 22:11:48 +00:00
Joey Hess
e41f8c83f3
close stdin handles before waiting on commands
Fixes reversion in recent conversions, the old code relied on the GC
apparently, but the new code explicitly waits on the process, so must
close stdin handle first or the command will never exit.
2020-06-05 17:27:49 -04:00
Joey Hess
ef0024444b
fix reversion
It was not the wrong handle. The handle was not being closed, so bup
kept running.

Before 2670890b17, the code was:

withHandle StdinHandle createProcessSuccess cmd feeder

The stdin handle was not closed by the feeder.

Testing this:

	withHandle StdinHandle createProcessSuccess (proc "cat" []) (\h -> hPutStrLn h "hi")

There's a rather long pause, a couple seconds, before it completes, but
it does complete. With hClose h, it immediately completes. This must be
the GC noticing that h is out of scope and closing it.

It seems likely that the old code worked only by that accident.

So, other similar changes made in that and nearby commits may also
have this problem, and need to explicitly close handles that were
somehow implicitly closed before.
2020-06-05 17:10:52 -04:00
Joey Hess
291774779f
use right handle 2020-06-05 16:45:12 -04:00
Joey Hess
05703893af
use right handle 2020-06-05 16:38:11 -04:00
Joey Hess
0fd72ff8e0
Merge branch 'master' of ssh://git-annex.branchable.com 2020-06-05 15:49:01 -04:00
Joey Hess
0210e81d83
async exception safety for openFd
Audited for openFile and openFd, and this fixes all the ones I found
where an async exception could prevent the file getting closed.

Except for the lock pool, which is a whole other can of worms.
2020-06-05 15:48:00 -04:00
Joey Hess
1dd770b1af
fix file descriptor leak
when importing from a directory special remote that is configured with
exporttree=yes
2020-06-05 15:34:43 -04:00
Joey Hess
319f2a4afc
audit all uses of SomeException to avoid catching async exceptions
Except for the assistant, which I think may use them between threads?

Most of the uses of SomeException were already catching only async exceptions.
But I did find a few places that were accidentially catching them.
2020-06-05 15:16:57 -04:00
mario
38d98ce550 Added a comment: Get missing files in --hide-missing branch 2020-06-05 19:14:26 +00:00
Joey Hess
dca19099a9
async exception safety
Masking ensures that EndStderrHandler gets written, so the helper
threads shut down.

However, nothing currently guarantees that calls to closeP2PSshConnection
are async exception safe, so made a note about it.

At this point, I've audited all calls to async, and made them all async
exception safe, except for ones in the assistant, and a few in leaf
commands (remotedaemon, enable-tor, multicast, p2p) which don't need to
be.
2020-06-05 14:56:41 -04:00
Joey Hess
a477f7253c
async exception safety 2020-06-05 14:42:11 -04:00
Joey Hess
660d8d3a87
simpler way to do this
Remove old code that can be trivially implemented using async in a much
nicer way (that is async exception safe).

I've audited all forkOS calls (except for ones in the assistant),
and this was the last remaining one that is not async exception safe.
The rest look ok to me.
2020-06-05 14:18:06 -04:00
Joey Hess
074260f036
async exception safety
Use async/cancel so helper threads are not left running.

Bracket createPipe to ensure the handles get closed.
2020-06-05 14:08:46 -04:00
Joey Hess
a0d09f1d9e
bracket createPipe for async exception safety 2020-06-05 13:58:04 -04:00
Joey Hess
9703ef8ae1
update 2020-06-05 12:12:20 -04:00