#30747 closed defect (fixed)

Unclear check for skipping scaling due to missing bandwidths or missing descriptors

Reported by: teor Owned by:
Priority: High Milestone: sbws: 1.1.x-final
Component: Core Tor/sbws Version: sbws: 1.1.0
Severity: Major Keywords: sbws-majority-blocker-maybe
Cc: juga Actual Points: 0.2
Parent ID: #30733 Points: 0.2
Reviewer: juga Sponsor:


We skip old results when scaling, but there are a few things wrong with this check:

  1. It is hard to tell what this line does, because it mixes "and" and "or" without brackets: l.desc_bw_obs_last or l.desc_bw_obs_mean and l.desc_bw_avg
  2. We skip scaling if any input is missing, but then we check desc_bw_obs_type and ignore some inputs
  3. If we are missing a descriptor for long enough, we stop generating results for a relay. We could use a substitute value instead.
                if not(l.desc_bw_obs_last or l.desc_bw_obs_mean and l.desc_bw_avg):
                    log.debug("Skipping %s from scaling, because there were not "
                              "descriptor bandwidths.", l.nick)
                if desc_bw_obs_type == TORFLOW_OBS_LAST:
                    desc_bw_obs = l.desc_bw_obs_last
                elif desc_bw_obs_type == TORFLOW_OBS_MEAN:
                    desc_bw_obs = l.desc_bw_obs_mean


Child Tickets

Change History (4)

comment:1 Changed 13 months ago by teor

Actual Points: 0.2
Keywords: sbws-majority-blocker-maybe added
Points: 0.2
Priority: MediumHigh
Reviewer: juga
Severity: NormalMajor
Status: newneeds_review

Python evaluates "and" before "or", so this code was doing:
if not(l.desc_bw_obs_last or (l.desc_bw_obs_mean and l.desc_bw_avg)):
which is obviously wrong.


See my pull request, which only skips the relay if we're actually going to use the attribute:

comment:2 Changed 12 months ago by juga

Status: needs_reviewmerge_ready


comment:3 Changed 12 months ago by gaba

Can we merge this? Anything else that needs to be done here?

comment:4 in reply to:  3 Changed 11 months ago by juga

Resolution: fixed
Status: merge_readyclosed

Replying to gaba:

Can we merge this? Anything else that needs to be done here?

No, just lack of time in the last month to work on sbws code.

Note: See TracTickets for help on using tickets.