summaryrefslogtreecommitdiff
path: root/doc/bugs/git_annex_remotedaemon_fails_to_connect_after_several_LOSTNET_messages_in_a_row.mdwn
blob: eaaf5a43767ab42dfa849f4362ff845897b8fc8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
### Please describe the problem.

git annex remotedaemon fails to reconnect after receiving several LOSTNET messages and RESUME.

Initially I've encountered the issue by noticing that git annex assistant stops updating local working copy after suspend/resume of laptop. Later I've found out that the same issue happens when disconnecting from network via NetworkManager and connecting back.

After some experiments with git annex remotedaemon I've found out that it incorrectly handles several LOSTNET messages in a row. After RESUME remotedaemon starts new SSH process and sends DISCONNECTED right away. Also it doesn't try to reconnect with backoff as it does with bad connection.

I've checked sources and with some logging found that it sends DISCONNECTED because of some kind of queueing of LOSTNET and switching to stopped mode right after RESUME. Unfortunately I don't know haskell to fix it myself.

### What steps will reproduce the problem?

[[!format sh """
% git annex remotedaemon --debug
[2014-12-19 11:07:13 NOVT] read: git ["config","--null","--list"]
[2014-12-19 11:07:13 NOVT] read: ssh ["-O","stop","-S","git@annex","-o","ControlMaster=auto","-o","ControlPersist=yes","localhost"]
[2014-12-19 11:07:13 NOVT] chat: ssh ["-S",".git/annex/ssh/git@annex","-o","ControlMaster=auto","-o","ControlPersist=yes","-T","git@annex","git-annex-shell 'notifychanges' '/~/annex' --uuid 858bc960-d379-4694-a6b8-98eba5fbeb82"]
CONNECTED ssh://git@annex/~/annex
[2014-12-19 11:07:13 NOVT] chat: git ["--git-dir=/home/user/annex/.git","--work-tree=/home/user/annex","cat-file","--batch"]
LOSTNET   
[2014-12-19 11:07:21 NOVT] read: ssh ["-O","stop","-S","git@annex","-o","ControlMaster=auto","-o","ControlPersist=yes","localhost"]
DISCONNECTED ssh://git@annex/~/annex
LOSTNET
RESUME
[2014-12-19 11:07:27 NOVT] chat: ssh ["-S",".git/annex/ssh/git@annex","-o","ControlMaster=auto","-o","ControlPersist=yes","-T","git@annex","git-annex-shell 'notifychanges' '/~/annex' --uuid 858bc960-d379-4694-a6b8-98eba5fbeb82"]
DISCONNECTED ssh://git@annex/~/annex
"""]]

### What version of git-annex are you using? On what operating system?

git-annex 5.20141203 on Gentoo Linux

### Please provide any additional information below.

Here is the original assistant log:

[[!format sh """

[2014-12-19 11:14:47 NOVT] NetWatcher: detected network disconnection
[2014-12-19 11:14:47 NOVT] RemoteControl: LOSTNET
[2014-12-19 11:14:47 NOVT] RemoteControl: DISCONNECTED ssh://git@annex/~/annex
[2014-12-19 11:14:47 NOVT] RemoteControl: fromList []
[2014-12-19 11:14:49 NOVT] NetWatcher: detected network disconnection
[2014-12-19 11:14:49 NOVT] RemoteControl: LOSTNET
[2014-12-19 11:14:52 NOVT] NetWatcher: detected network disconnection
[2014-12-19 11:14:52 NOVT] RemoteControl: LOSTNET
[2014-12-19 11:14:52 NOVT] NetWatcher: detected network disconnection
[2014-12-19 11:14:52 NOVT] RemoteControl: LOSTNET
[2014-12-19 11:14:53 NOVT] NetWatcher: detected network connection
[2014-12-19 11:14:53 NOVT] NetWatcher: Syncing with origin 
[2014-12-19 11:14:53 NOVT] read: git ["--git-dir=/home/user/annex/.git","--work-tree=/home/user/annex","symbolic-ref","HEAD"]
[2014-12-19 11:14:53 NOVT] read: git ["--git-dir=/home/user/annex/.git","--work-tree=/home/user/annex","show-ref","refs/heads/master"]
[2014-12-19 11:14:53 NOVT] call: git ["--git-dir=/home/user/annex/.git","--work-tree=/home/user/annex","fetch","origin"]
[2014-12-19 11:14:54 NOVT] read: git ["--git-dir=/home/user/annex/.git","--work-tree=/home/user/annex","show-ref","git-annex"]
[2014-12-19 11:14:54 NOVT] read: git ["--git-dir=/home/user/annex/.git","--work-tree=/home/user/annex","show-ref","--hash","refs/heads/git-annex"]
[2014-12-19 11:14:54 NOVT] read: git ["--git-dir=/home/user/annex/.git","--work-tree=/home/user/annex","log","refs/heads/git-annex..b85cddc187d388ab12d18fddbdef266565e81e43","-n1","--pretty=%H"]
[2014-12-19 11:14:54 NOVT] read: git ["--git-dir=/home/user/annex/.git","--work-tree=/home/user/annex","log","refs/heads/git-annex..12f83429b96850f81ff8edfc0a8651bfa65a066b","-n1","--pretty=%H"]
[2014-12-19 11:14:54 NOVT] call: git ["--git-dir=/home/user/annex/.git","--work-tree=/home/user/annex","show-ref","--verify","-q","refs/remotes/origin/master"]
[2014-12-19 11:14:54 NOVT] read: git ["--git-dir=/home/user/annex/.git","--work-tree=/home/user/annex","log","refs/heads/master..refs/remotes/origin/master","-n1","--pretty=%H"]
[2014-12-19 11:14:54 NOVT] call: git ["--git-dir=/home/user/annex/.git","--work-tree=/home/user/annex","show-ref","--verify","-q","refs/remotes/origin/synced/master"]
[2014-12-19 11:14:54 NOVT] read: git ["--git-dir=/home/user/annex/.git","--work-tree=/home/user/annex","log","refs/heads/synced/master..refs/remotes/origin/synced/master","-n1","--pretty=%H"]
[2014-12-19 11:14:54 NOVT] read: git ["--git-dir=/home/user/annex/.git","--work-tree=/home/user/annex","symbolic-ref","HEAD"]
[2014-12-19 11:14:54 NOVT] read: git ["--git-dir=/home/user/annex/.git","--work-tree=/home/user/annex","show-ref","refs/heads/master"]
[2014-12-19 11:14:54 NOVT] NetWatcher: pushing to [Remote { name ="origin" }]
[2014-12-19 11:14:54 NOVT] call: git ["--git-dir=/home/user/annex/.git","--work-tree=/home/user/annex","push","origin","+git-annex:synced/git-annex","master:synced/master"]
Everything up-to-date
[2014-12-19 11:14:54 NOVT] read: git ["--git-dir=/home/user/annex/.git","--work-tree=/home/user/annex","push","origin","master"]
[2014-12-19 11:14:54 NOVT] RemoteControl: RESUME
[2014-12-19 11:14:54 NOVT] RemoteControl: DISCONNECTED ssh://git@annex/~/annex
[2014-12-19 11:14:54 NOVT] RemoteControl: fromList []


"""]]

[[!tag confirmed]]