Endpoint weighted selection algorithm fails if weights are 0
Open
@clelland is already working on this.
Since Jul 29, 2022.
network reporting
report-delivery
- Dominant language
- Bikeshed
- Stars
- 84
- Forks
- 39
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 1
Description
An endpoint's weight is a non-negative integer, i.e. it is allowed to be 0. If all the endpoints with the minimum priority value have weight 0, then in step 9 of the Choose an endpoint from group algorithm, it will be impossible to choose a random weight value that is >= 0 and also < total_weight (i.e. 0).
Also, the algorithm as written does not give endpoints with weight 0 any chance of being selected. This differs from the cited algorithm in RFC 2782, which does give endpoints with weight 0 a (small) chance of being selected.
(Credit to Eric Orth for pointing this out.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.