File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
linkerd/distribute/src/service Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11use crate :: { keys:: KeyId , WeightedServiceKeys } ;
22use ahash:: HashMap ;
33use linkerd_stack:: { NewService , Service } ;
4- use rand:: { distributions :: WeightedError , rngs:: SmallRng , SeedableRng } ;
4+ use rand:: { rngs:: SmallRng , SeedableRng } ;
55use std:: {
66 hash:: Hash ,
77 sync:: Arc ,
@@ -21,7 +21,7 @@ pub(crate) struct RandomAvailableSelection<K, S> {
2121}
2222
2323fn new_rng ( ) -> SmallRng {
24- SmallRng :: from_rng ( rand:: thread_rng ( ) ) . expect ( "RNG must initialize" )
24+ SmallRng :: from_rng ( & mut rand:: rng ( ) )
2525}
2626
2727impl < K , S > RandomAvailableSelection < K , S > {
9292 // to `poll_ready` can try this backend again.
9393 match selector. disable_backend ( id) {
9494 Ok ( ( ) ) => { }
95- Err ( WeightedError :: AllWeightsZero ) => {
95+ Err ( rand :: distr :: weighted :: Error :: InsufficientNonZero ) => {
9696 // There are no backends remaining.
9797 break ;
9898 }
You can’t perform that action at this time.
0 commit comments