w3c / w3c/reporting

Endpoint weighted selection algorithm fails if weights are 0

Open
#153 7 comments 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.