@@ -185,12 +185,12 @@ func (cs *ClientSet) resetBackoff() *wait.Backoff {
185
185
}
186
186
187
187
// sync makes sure that #clients >= #proxy servers
188
- func (cs * ClientSet ) sync (ctx context. Context ) {
188
+ func (cs * ClientSet ) sync () {
189
189
defer cs .shutdown ()
190
190
backoff := cs .resetBackoff ()
191
191
var duration time.Duration
192
192
for {
193
- if serverCount , err := cs .connectOnce (ctx ); err != nil {
193
+ if serverCount , err := cs .connectOnce (); err != nil {
194
194
if dse , ok := err .(* DuplicateServerError ); ok {
195
195
clientsCount := cs .ClientsCount ()
196
196
klog .V (4 ).InfoS ("duplicate server" , "serverID" , dse .ServerID , "serverCount" , serverCount , "clientsCount" , clientsCount )
@@ -217,10 +217,10 @@ func (cs *ClientSet) sync(ctx context.Context) {
217
217
}
218
218
}
219
219
220
- func (cs * ClientSet ) ServerCount (ctx context. Context ) int {
220
+ func (cs * ClientSet ) ServerCount () int {
221
221
var serverCount int
222
222
if cs .leaseCounter != nil {
223
- serverCount = cs .leaseCounter .Count (ctx )
223
+ serverCount = cs .leaseCounter .Count ()
224
224
} else {
225
225
serverCount = cs .lastReceivedServerCount
226
226
}
@@ -234,8 +234,8 @@ func (cs *ClientSet) ServerCount(ctx context.Context) int {
234
234
return serverCount
235
235
}
236
236
237
- func (cs * ClientSet ) connectOnce (ctx context. Context ) (int , error ) {
238
- serverCount := cs .ServerCount (ctx )
237
+ func (cs * ClientSet ) connectOnce () (int , error ) {
238
+ serverCount := cs .ServerCount ()
239
239
240
240
if ! cs .syncForever && serverCount != 0 && cs .ClientsCount () >= serverCount {
241
241
return serverCount , nil
@@ -265,7 +265,7 @@ func (cs *ClientSet) Serve() {
265
265
"agentIdentifiers" , cs .agentIdentifiers ,
266
266
"serverAddress" , cs .address ,
267
267
)
268
- go runpprof .Do (context .Background (), labels , func (ctx context.Context ) { cs .sync (ctx ) })
268
+ go runpprof .Do (context .Background (), labels , func (ctx context.Context ) { cs .sync () })
269
269
}
270
270
271
271
func (cs * ClientSet ) shutdown () {
0 commit comments