git-annex/doc
Joey Hess 6ecd55a9fa
Fixed some other potential hangs in the P2P protocol
Finishes the start made in 983c9d5a53, by
handling the case where `transfer` fails for some other reason, and so the
ReadContent callback does not get run. I don't know of a case where
`transfer` does fail other than the locking dealt with in that commit, but
it's good to have a guarantee.

StoreContent and StoreContentTo had a similar problem.
Things like `getViaTmp` may decide not to run the transfer action.
And `transfer` could certianly fail, if another transfer of the same
object was in progress. (Or a different object when annex.pidlock is set.)

If the transfer action was not run, the content of the object would
not all get consumed, and so would get interpreted as protocol commands,
which would not go well.

My approach to fixing all of these things is to set a TVar only
once all the data in the transfer is known to have been read/written.
This way the internals of `transfer`, `getViaTmp` etc don't matter.

So in ReadContent, it checks if the transfer completed.
If not, as long as it didn't throw an exception, send empty and Invalid
data to the callback. On an exception the state of the protocol is unknown
so it has to raise ProtoFailureException and close the connection,
same as before.

In StoreContent, if the transfer did not complete
some portion of the DATA has been read, so the protocol is in an unknown
state and it has to close the conection as well.

(The ProtoFailureMessage used here matches the one in Annex.Transfer, which
is the most likely reason. Not ideal to duplicate it..)

StoreContent did not ever close the protocol connection before. So this is
a protocol change, but only in an exceptional circumstance, and it's not
going to break anything, because clients already need to deal with the
connection breaking at any point.

The way this new behavior looks (here origin has annex.pidlock = true so will
only accept one upload to it at a time):

git annex copy --to origin -J2
copy x (to origin...) ok
copy y (to origin...)
  Lost connection (fd:25: hGetChar: end of file)

This work is supported by the NIH-funded NICEMAN (ReproNim TR&D3) project.
2018-11-06 14:52:32 -04:00
..
android update android docs for termux 2018-10-13 12:11:47 -04:00
Android rename to avoid render as html 2018-10-16 11:23:31 -04:00
assistant Added a comment: Diagnosing local pairing issues. 2018-07-30 18:54:56 +00:00
automatic_conflict_resolution
backends Added a comment 2018-11-01 17:13:00 +00:00
bare_repositories
benchmarking
bugs Fixed some other potential hangs in the P2P protocol 2018-11-06 14:52:32 -04:00
coding_style
contribute
copies
design Fixed some other potential hangs in the P2P protocol 2018-11-06 14:52:32 -04:00
devblog devblog 2018-10-30 18:11:11 -04:00
direct_mode response 2018-09-24 11:41:36 -04:00
download
ekg
encryption
footer
forum Added a comment 2018-11-05 18:21:54 +00:00
future_proofing
git-annex-add
git-annex-addurl response 2018-05-30 12:31:24 -04:00
git-annex-adjust
git-annex-checkpresentkey response 2018-09-24 11:31:37 -04:00
git-annex-config
git-annex-copy
git-annex-direct
git-annex-drop Added a comment: re: drop everything but subdirectory 2018-09-07 20:13:03 +00:00
git-annex-enableremote
git-annex-find Added a comment 2018-10-24 11:42:15 +00:00
git-annex-importfeed
git-annex-metadata comment 2018-09-11 12:35:20 -04:00
git-annex-move response 2018-09-24 11:20:31 -04:00
git-annex-preferred-content
git-annex-reinject
git-annex-rmurl clean up url removal presence update 2018-10-04 17:35:49 -04:00
git-annex-setpresentkey Added a comment 2018-10-08 21:43:17 +00:00
git-annex-sync Added a comment 2018-10-09 18:41:33 +00:00
git-annex-test Added a comment 2018-09-25 18:22:17 +00:00
git-annex-unannex
git-annex-undo
git-annex-unused response 2018-09-25 14:10:57 -04:00
git-annex-whereis response 2018-09-24 11:34:55 -04:00
how_it_works
install removed 2018-11-03 05:24:04 +00:00
internals removed 2018-10-12 20:35:05 +00:00
license
links
metadata Added a comment: TODO written 2015-05-06 14:24:56 +00:00
news add news item for git-annex 7.20181105 2018-11-05 13:33:59 -04:00
not
polls
preferred_content
required_content
scalability
security response 2018-09-11 12:49:41 -04:00
special_remotes response 2018-09-11 13:37:28 -04:00
stickers
sync
templates
testimonials
thanks update 2018-11-04 15:06:06 -04:00
tips Added a comment 2018-11-06 16:10:11 +00:00
todo report failure to build against stretch 2018-11-05 20:20:30 +00:00
trust
tuning
upgrades
use_case
users Added a comment: git-annex 2018-10-04 14:19:17 +00:00
videos
walkthrough Added a comment 2018-10-13 20:47:44 +00:00
Android.mdwn remove section on direct mode 2018-10-26 13:57:17 -04:00
assistant.mdwn
automatic_conflict_resolution.mdwn
backends.mdwn added details about the URL backend 2018-10-12 20:28:25 +00:00
bare_repositories.mdwn
benchmarking.mdwn
bugs.mdwn
builds.mdwn remove old android app autobuild 2018-10-13 12:13:13 -04:00
chunking.mdwn
coding_style.mdwn
comments.mdwn
contact.mdwn update my email address and homepage url 2015-01-21 12:50:09 -04:00
contribute.mdwn update thanks, listing code and other significant non-financial contributors 2018-11-05 15:07:14 -04:00
copies.mdwn
design.mdwn
devblog.mdwn
direct_mode.mdwn fix autoupgrade from v6 to go to v7, not v5 2018-10-25 18:40:04 -04:00
distributed_version_control.mdwn
download.mdwn
ekg.mdwn
encryption.mdwn
favicon.ico
forum.mdwn
future_proofing.mdwn fix link 2018-10-26 16:21:34 -04:00
git-annex-add.mdwn some more v6 -> v7 doc changes 2018-10-26 13:56:36 -04:00
git-annex-addunused.mdwn
git-annex-addurl.mdwn added -z 2018-09-20 16:11:47 -04:00
git-annex-adjust.mdwn sync --content now supports --hide-missing adjusted branches 2018-10-19 17:51:25 -04:00
git-annex-assistant.mdwn
git-annex-calckey.mdwn added -z 2018-09-20 16:11:47 -04:00
git-annex-checkpresentkey.mdwn
git-annex-config.mdwn
git-annex-contentlocation.mdwn
git-annex-copy.mdwn added -z 2018-09-20 16:11:47 -04:00
git-annex-dead.mdwn
git-annex-describe.mdwn
git-annex-diffdriver.mdwn
git-annex-direct.mdwn
git-annex-drop.mdwn added -z 2018-09-20 16:11:47 -04:00
git-annex-dropkey.mdwn
git-annex-dropunused.mdwn
git-annex-edit.mdwn
git-annex-enable-tor.mdwn
git-annex-enableremote.mdwn
git-annex-examinekey.mdwn remove addition 2018-10-16 11:00:22 -04:00
git-annex-expire.mdwn
git-annex-export.mdwn sync: Warn when a remote's export is not updated to the current tree because export tracking is not configured. 2018-09-27 15:41:18 -04:00
git-annex-find.mdwn added -z 2018-09-20 16:11:47 -04:00
git-annex-findref.mdwn
git-annex-fix.mdwn
git-annex-forget.mdwn
git-annex-fromkey.mdwn added -z 2018-09-20 16:11:47 -04:00
git-annex-fsck.mdwn
git-annex-fuzztest.mdwn
git-annex-get.mdwn added -z 2018-09-20 16:11:47 -04:00
git-annex-group.mdwn
git-annex-groupwanted.mdwn document that multiple groupwanted are not combined 2018-06-12 12:44:53 -04:00
git-annex-import.mdwn man page link fixes 2018-07-06 12:51:18 -04:00
git-annex-importfeed.mdwn default to not using youtube-dl, for security 2018-06-17 14:51:02 -04:00
git-annex-indirect.mdwn
git-annex-info.mdwn added -z 2018-09-20 16:11:47 -04:00
git-annex-init.mdwn
git-annex-initremote.mdwn
git-annex-inprogress.mdwn
git-annex-list.mdwn
git-annex-lock.mdwn
git-annex-log.mdwn
git-annex-lookupkey.mdwn added -z 2018-09-20 16:11:47 -04:00
git-annex-map.mdwn
git-annex-matchexpression.mdwn
git-annex-matching-options.mdwn Added --accessedwithin matching option. 2018-08-01 15:34:03 -04:00
git-annex-merge.mdwn
git-annex-metadata.mdwn more precise description of where git-annex metadata gets attached 2018-10-02 16:53:53 +00:00
git-annex-migrate.mdwn
git-annex-mirror.mdwn
git-annex-move.mdwn added -z 2018-09-20 16:11:47 -04:00
git-annex-multicast.mdwn man page link fixes 2018-07-06 12:51:18 -04:00
git-annex-numcopies.mdwn
git-annex-p2p.mdwn add docs about p2p --pair being broken in old versions 2018-07-05 11:52:52 -04:00
git-annex-post-receive.mdwn
git-annex-pre-commit.mdwn some more v6 -> v7 doc changes 2018-10-26 13:56:36 -04:00
git-annex-preferred-content.mdwn man page link fixes 2018-07-06 12:51:18 -04:00
git-annex-proxy.mdwn
git-annex-readpresentkey.mdwn
git-annex-registerurl.mdwn added -z 2018-09-20 16:11:47 -04:00
git-annex-reinit.mdwn
git-annex-reinject.mdwn
git-annex-rekey.mdwn added -z 2018-09-20 16:11:47 -04:00
git-annex-remotedaemon.mdwn
git-annex-repair.mdwn
git-annex-required.mdwn man page link fixes 2018-07-06 12:51:18 -04:00
git-annex-resolvemerge.mdwn
git-annex-rmurl.mdwn mention location tracking 2018-10-04 17:37:20 -04:00
git-annex-schedule.mdwn
git-annex-semitrust.mdwn
git-annex-setkey.mdwn
git-annex-setpresentkey.mdwn setpresentkey: Added --batch support (for ronnypfa) 2018-05-27 14:56:14 -04:00
git-annex-shell.mdwn remove todo link 2018-07-06 12:32:58 -04:00
git-annex-smudge.mdwn defer updating unlocked files until after smudge filter 2018-10-25 15:08:20 -04:00
git-annex-status.mdwn
git-annex-sync.mdwn sync --content now supports --hide-missing adjusted branches 2018-10-19 17:51:25 -04:00
git-annex-test.mdwn
git-annex-testremote.mdwn
git-annex-transferkey.mdwn
git-annex-transferkeys.mdwn
git-annex-trust.mdwn
git-annex-unannex.mdwn
git-annex-undo.mdwn
git-annex-ungroup.mdwn
git-annex-uninit.mdwn
git-annex-unlock.mdwn some more v6 -> v7 doc changes 2018-10-26 13:56:36 -04:00
git-annex-untrust.mdwn
git-annex-unused.mdwn unused --from: Allow specifiying a repository by uuid or description. 2018-07-11 16:01:35 -04:00
git-annex-upgrade.mdwn
git-annex-vadd.mdwn
git-annex-vcycle.mdwn
git-annex-version.mdwn
git-annex-vfilter.mdwn
git-annex-vicfg.mdwn
git-annex-view.mdwn
git-annex-vpop.mdwn
git-annex-wanted.mdwn
git-annex-watch.mdwn
git-annex-webapp.mdwn
git-annex-whereis.mdwn response 2018-09-24 11:34:55 -04:00
git-annex.mdwn some more v6 -> v7 doc changes 2018-10-26 13:56:36 -04:00
git-remote-tor-annex.mdwn
git-union-merge.mdwn
how_it_works.mdwn
index.mdwn
install.mdwn Add Guix to the installation instructions, as there is now package available! 2018-06-01 14:38:16 +00:00
internals.mdwn added anchor for git-annex branch 2018-09-25 16:54:00 +00:00
license.mdwn
location_tracking.mdwn
logo-old-bw.svg
logo-old.png
logo-old.svg
logo-old_small.png
logo.mdwn
logo.svg
logo_16x16.png
logo_32x32.png
logo_small.png
meta.mdwn
metadata.mdwn
news.mdwn add security page with current and past security holes 2018-06-18 14:19:58 -04:00
not.mdwn
polls.mdwn
preferred_content.mdwn
privacy.mdwn
publicrepos.mdwn we grew up to over 50TB 2018-09-14 02:53:11 +00:00
related_software.mdwn Add AnnexRemote to the list 2018-07-31 13:44:27 +00:00
repomap.png
required_content.mdwn
scalability.mdwn
security.mdwn add security page with current and past security holes 2018-06-18 14:19:58 -04:00
shortcuts.mdwn
sidebar.mdwn
sitemap.mdwn
special_remotes.mdwn close old todo and add freenet special remote to list 2018-10-03 12:54:34 -04:00
stickers.mdwn
submodules.mdwn
summary.mdwn
sync.mdwn
testimonials.mdwn
thanks.mdwn update thanks, listing code and other significant non-financial contributors 2018-11-05 15:07:14 -04:00
tips.mdwn
todo.mdwn
transferring_data.mdwn
trust.mdwn
tuning.mdwn
upgrades.mdwn v7 2018-10-25 18:24:23 -04:00
users.mdwn
videos.mdwn
Void.mdwn
walkthrough.mdwn
workflow.mdwn