@@ -64,7 +64,7 @@ func (wb *weightedBalancer) GetPicker(ctx context.Context, e discovery.Result) P
6464 picker , ok := wb .pickerCache .Load (e .CacheKey )
6565 if ! ok {
6666 picker , _ , _ = wb .sfg .Do (e .CacheKey , func () (interface {}, error ) {
67- klog .CtxErrorf (ctx , "KITEX-DEBUG: start createPicker, CacheKey=%s" , e .CacheKey )
67+ klog .CtxErrorf (ctx , "KITEX-DEBUG: start createPicker, CacheKey=%s, instanceSize=%d " , e .CacheKey , len ( e . Instances ) )
6868 p := wb .createPicker (ctx , e )
6969 klog .CtxErrorf (ctx , "KITEX-DEBUG: end createPicker, CacheKey=%s" , e .CacheKey )
7070 wb .pickerCache .Store (e .CacheKey , p )
@@ -79,6 +79,7 @@ func (wb *weightedBalancer) createPicker(ctx context.Context, e discovery.Result
7979 weightSum := 0
8080 balance := true
8181 cnt := 0
82+ klog .CtxErrorf (ctx , "KITEX-DEBUG: createPicker, begin iterator" )
8283 for idx , instance := range e .Instances {
8384 weight := instance .Weight ()
8485 if weight <= 0 {
@@ -92,6 +93,7 @@ func (wb *weightedBalancer) createPicker(ctx context.Context, e discovery.Result
9293 }
9394 cnt ++
9495 }
96+ klog .CtxErrorf (ctx , "KITEX-DEBUG: createPicker, end iterator, size=%d" , len (instances ))
9597 instances = instances [:cnt ]
9698 if len (instances ) == 0 {
9799 return new (DummyPicker )
@@ -102,7 +104,9 @@ func (wb *weightedBalancer) createPicker(ctx context.Context, e discovery.Result
102104 if balance {
103105 picker = newRoundRobinPicker (instances )
104106 } else {
105- picker = newWeightedRoundRobinPicker (instances )
107+ klog .CtxErrorf (ctx , "KITEX-DEBUG: start newWeightedRoundRobinPicker" )
108+ picker = newWeightedRoundRobinPicker (ctx , instances )
109+ klog .CtxErrorf (ctx , "KITEX-DEBUG: end newWeightedRoundRobinPicker" )
106110 }
107111 default : // random
108112 if balance {
0 commit comments