@@ -93,6 +93,7 @@ func (cs *commandService) CreateConnection(
93
93
Error : err .Error (),
94
94
},
95
95
}
96
+ cs .logger .Error (err , "error getting pod owner" )
96
97
return response , grpcStatus .Errorf (codes .Internal , "error getting pod owner %s" , err .Error ())
97
98
}
98
99
@@ -145,12 +146,12 @@ func (cs *commandService) Subscribe(in pb.CommandService_SubscribeServer) error
145
146
146
147
return err
147
148
}
149
+ deployment .Lock .RUnlock ()
148
150
149
151
// subscribe to the deployment broadcaster to get file updates
150
152
broadcaster := deployment .GetBroadcaster ()
151
153
channels := broadcaster .Subscribe ()
152
154
defer broadcaster .CancelSubscription (channels .ID )
153
- deployment .Lock .RUnlock ()
154
155
155
156
for {
156
157
select {
@@ -175,7 +176,10 @@ func (cs *commandService) Subscribe(in pb.CommandService_SubscribeServer) error
175
176
return grpcStatus .Error (codes .Internal , err .Error ())
176
177
}
177
178
case err = <- msgr .Errors ():
178
- cs .logger .Error (err , "connection error" )
179
+ cs .logger .Error (err , "connection error" , "pod" , conn .PodName )
180
+ deployment .SetPodErrorStatus (conn .PodName , err )
181
+ channels .ResponseCh <- struct {}{}
182
+
179
183
if errors .Is (err , io .EOF ) {
180
184
return grpcStatus .Error (codes .Aborted , err .Error ())
181
185
}
@@ -214,7 +218,7 @@ func (cs *commandService) waitForConnection(
214
218
case <- timer .C :
215
219
return nil , nil , err
216
220
case <- ticker .C :
217
- if conn , ok := cs .connTracker .ConnectionIsReady (gi .IPAddress ); ok {
221
+ if conn , ok := cs .connTracker .Ready (gi .IPAddress ); ok {
218
222
// connection has been established, now ensure that the deployment exists in the store
219
223
if deployment := cs .nginxDeployments .Get (conn .Parent ); deployment != nil {
220
224
return & conn , deployment , nil
@@ -332,7 +336,7 @@ func (cs *commandService) logAndSendErrorStatus(deployment *Deployment, conn *ag
332
336
if err != nil {
333
337
cs .logger .Error (err , "error sending request to agent" )
334
338
} else {
335
- cs .logger .Info (fmt . Sprintf ( "Successfully configured nginx for new subscription %q" , conn .PodName ) )
339
+ cs .logger .Info ("Successfully configured nginx for new subscription" , "pod" , conn .PodName )
336
340
}
337
341
deployment .SetPodErrorStatus (conn .PodName , err )
338
342
0 commit comments