6
6
"github.com/git-lfs/git-lfs/v3/config"
7
7
"github.com/git-lfs/git-lfs/v3/subprocess"
8
8
"github.com/git-lfs/pktline"
9
+ "github.com/rubyist/tracerx"
9
10
)
10
11
11
12
type SSHTransfer struct {
@@ -35,6 +36,7 @@ func NewSSHTransfer(osEnv config.Environment, gitEnv config.Environment, meta *S
35
36
}
36
37
37
38
func startConnection (id int , osEnv config.Environment , gitEnv config.Environment , meta * SSHMetadata , operation string ) (* PktlineConnection , bool , error ) {
39
+ tracerx .Printf ("spawning pure SSH connection" )
38
40
exe , args , multiplexing := GetLFSExeAndArgs (osEnv , gitEnv , meta , "git-lfs-transfer" , operation , true )
39
41
cmd , err := subprocess .ExecCommand (exe , args ... )
40
42
if err != nil {
@@ -71,6 +73,7 @@ func startConnection(id int, osEnv config.Environment, gitEnv config.Environment
71
73
w .Close ()
72
74
cmd .Wait ()
73
75
}
76
+ tracerx .Printf ("pure SSH connection successful" )
74
77
return conn , multiplexing , err
75
78
}
76
79
@@ -121,6 +124,7 @@ func (tr *SSHTransfer) setConnectionCount(n int) error {
121
124
count := len (tr .conn )
122
125
if n < count {
123
126
for _ , item := range tr .conn [n :count ] {
127
+ tracerx .Printf ("terminating pure SSH connection (%d -> %d)" , count , n )
124
128
if err := item .End (); err != nil {
125
129
return err
126
130
}
@@ -130,6 +134,7 @@ func (tr *SSHTransfer) setConnectionCount(n int) error {
130
134
for i := count ; i < n ; i ++ {
131
135
conn , _ , err := startConnection (i , tr .osEnv , tr .gitEnv , tr .meta , tr .operation )
132
136
if err != nil {
137
+ tracerx .Printf ("failed to spawn pure SSH connection: %s" , err )
133
138
return err
134
139
}
135
140
tr .conn = append (tr .conn , conn )
@@ -139,5 +144,6 @@ func (tr *SSHTransfer) setConnectionCount(n int) error {
139
144
}
140
145
141
146
func (tr * SSHTransfer ) Shutdown () error {
147
+ tracerx .Printf ("shutting down pure SSH connection" )
142
148
return tr .SetConnectionCount (0 )
143
149
}
0 commit comments