Open
Description
Currently in GrpclbState
, subchannel state change produces a new RoundRobinPicker
, which has dropIndex
initially 0. This may cause the client to drop more or less percentage of requests than the percentage of drop entries in the list.
To fix the problem, the dropIndex
of the previous picker should be passed to the new picker, if the new picker is due to subchannel state change. dropIndex
should be a mutable integer (maybe AtomicInteger
) shared by the previous and new pickers, so that the new picker doesn't take a premature snapshot of it.
In the case where the balancer sends a new drop list, dropIndex
will keep starting from 0.