[tor-bugs] #30747 [Core Tor/sbws]: Unclear check for skipping scaling due to missing bandwidths or missing descriptors

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Jun 17 07:41:14 UTC 2019


#30747: Unclear check for skipping scaling due to missing bandwidths or missing
descriptors
-----------------------------------------+---------------------------------
 Reporter:  teor                         |          Owner:  (none)
     Type:  defect                       |         Status:  needs_review
 Priority:  High                         |      Milestone:  sbws:
                                         |  1.1.x-final
Component:  Core Tor/sbws                |        Version:  sbws: 1.1.0
 Severity:  Major                        |     Resolution:
 Keywords:  sbws-majority-blocker-maybe  |  Actual Points:  0.2
Parent ID:  #30733                       |         Points:  0.2
 Reviewer:  juga                         |        Sponsor:
-----------------------------------------+---------------------------------
Changes (by teor):

 * status:  new => needs_review
 * severity:  Normal => Major
 * priority:  Medium => High
 * points:   => 0.2
 * actualpoints:   => 0.2
 * keywords:   => sbws-majority-blocker-maybe
 * reviewer:   => juga


Comment:

 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.

 Reference:
 https://docs.python.org/3/reference/expressions.html#operator-precedence

 See my pull request, which only skips the relay if we're actually going to
 use the attribute:
 https://github.com/torproject/sbws/pull/359

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/30747#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list