[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



#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
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs