@@ -229,7 +229,7 @@ func (sp *SourcePool) Close() {
229229
230230// newConn initializes a new consumer group config.
231231func (sp * SourcePool ) newConn (ctx context.Context , s Server ) (* kgo.Client , error ) {
232- sp .log .Debug ("running TCP health check" , "id" , s .ID , "server" , s .Config .BootstrapBrokers )
232+ sp .log .Debug ("running TCP health check" , "id" , s .ID , "server" , s .Config .BootstrapBrokers , "session_timeout" , s . Config . SessionTimeout )
233233 if ok := checkTCP (ctx , s .Config .BootstrapBrokers , s .Config .SessionTimeout ); ! ok {
234234 return nil , ErrorNoHealthy
235235 }
@@ -297,12 +297,14 @@ func (sp *SourcePool) healthcheck(ctx context.Context, signal chan struct{}) err
297297
298298 // For the first ever check, clients will be nil.
299299 if clients [i ] == nil {
300+ sp .log .Debug ("initializing admin client for background check" , "id" , s .ID , "server" , s .Config .BootstrapBrokers )
300301 cl , err := sp .initConsumerClient (s .Config )
301302 if err != nil {
302303 sp .log .Error ("error initializing admin client in background healthcheck" , "id" , s .ID , "server" , s .Config .BootstrapBrokers , "error" , err )
303304 continue
304305 }
305306
307+ sp .log .Debug ("initialized admin client for background check" , "id" , s .ID , "server" , s .Config .BootstrapBrokers )
306308 clients [i ] = cl
307309 }
308310
@@ -314,6 +316,7 @@ func (sp *SourcePool) healthcheck(ctx context.Context, signal chan struct{}) err
314316
315317 // Get the highest offset of all the topics on the source server and sum them up
316318 // to derive the weight of the server.
319+ sp .log .Debug ("getting high watermark via admin client for background check" , "id" , idx )
317320 offsets , err := sp .GetHighWatermark (ctx , clients [idx ])
318321 if err != nil && offsets == nil {
319322 sp .log .Error ("error fetching offset in background healthcheck" , "id" , s .ID , "server" , s .Config .BootstrapBrokers , "error" , err )
@@ -506,6 +509,7 @@ func (sp *SourcePool) setWeight(id int, weight int64) {
506509 sp .curCandidate = s
507510 }
508511
512+ sp .log .Debug ("setting candidate weight" , "id" , id , "weight" , weight , "curr" , sp .curCandidate )
509513 sp .servers [id ] = s
510514 break
511515 }
0 commit comments