[tor-bugs] #28061 [Core Tor/sbws]: Check prioritisation, it should make 2 measurements that are 24 appart

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Oct 18 09:20:55 UTC 2018


#28061: Check prioritisation, it should make 2 measurements that are 24 appart
---------------------------+-------------------------------------
 Reporter:  juga           |          Owner:  (none)
     Type:  defect         |         Status:  new
 Priority:  Medium         |      Milestone:  sbws 1.0 (MVP nice)
Component:  Core Tor/sbws  |        Version:
 Severity:  Normal         |     Resolution:
 Keywords:                 |  Actual Points:
Parent ID:  #28042         |         Points:
 Reviewer:                 |        Sponsor:
---------------------------+-------------------------------------

Comment (by juga):

 ----
 Replying to [comment:8 teor]:
 [...]
 >
 > Is there some documentation for relay priority?

 Relays are sorted by their ``data_period`` - ``time`` in results.
 https://gitweb.torproject.org/sbws.git/tree/sbws/lib/relayprioritizer.py#n65
 Relays with error results, get their delta multiplied by 0.5 or 0.4. So
 they will be measured earlier.
 https://gitweb.torproject.org/sbws.git/tree/sbws/lib/relayprioritizer.py#n76
 Relays with more than 1 result sum that delta
 https://gitweb.torproject.org/sbws.git/tree/sbws/lib/relayprioritizer.py#n77

 > If we prioritise failed relays, then most of our circuits will fail. In
 some cases, we will overload relays that are already failing.
 >
 > > > Can you please tell us:
 > > > * how long sbws has been running for?
 > >
 > > Forever :) Results dated older than 7 days ago are not took
 > > Those results were done without the last recent day, but still.
 > >
 > > > * the number of relays measured each day:
 > >
 > > This is the number of results each day, not relays:
 > >
 > > 1555 2018-10-10.txt
 > > 1485 2018-10-11.txt
 > > 1363 2018-10-12.txt
 > > 1574 2018-10-13.txt
 > > 1665 2018-10-14.txt
 >
 > If it takes 5 days for sbws to measure 7000 relays, then maybe sbws
 should use results from the last 10 days.

 That would work. Though after i commented the rtt code, i seems sbws can
 measure almost all the network in 1 day:
 6219 2018-10-17.txt

 >
 > > 1707 2018-10-15.txt
 > > 1819 2018-10-16.txt
 > > 3332 2018-10-17.txt
 >
 > ...
 >
 > > > * the exact code that you are using to do the "2 measurements at
 least 24 hours apart" test?
 > >
 > > https://gitweb.torproject.org/sbws.git/tree/sbws/lib/v3bwfile.py#n278
 >
 > Ok, so there is a bug in this code.
 >
 > The original task was:
 >
 > > If any of these things are true, do not put the relay in the bandwidth
 file:
 > > * there are less than 2 sbws measured bandwidths
 > > * all the sbws measured bandwidths are within 24 hours of each other
 >
 > But the code implements:
 >
 > 1. If there are less than 2 results, do not put the relay in the
 bandwidth file

 Is this not correct?

 > 2. If any result is within 24 hours of the previous result, remove it.
 Then, if there is only one result, do not put the relay in the bandwidth
 file.
 >
 > Here are some results and the outputs they should produce:
 > 0h produces None
 > 0h, 24h produces 0h, 24h
 > 0h, 1h, 24h produces 0h, 1h, 24h (but I think the current function
 produces 0h, 24h)
 > 0h, 24h, 36h produces 0h, 24h, 36h (but I think the current function
 produces 0h, 24h)

 Ok, i understood this wrong, though this does not change the number of
 relays.

 > Maybe these functions need some unit tests?

 Yeah, going to implement that

 > > > * the exact measurement times for a relay that passes the test?
 > >
 > > Attachment
 >
 > I don't understand this attachment.
 > It looks like a list of all the times that pass the test, with no relay
 ids.
 >
 > But I wanted to see a list of times for one relay that passes the test.

 Relay with 2 results that passes the test:

 7044955A4D7B04CF70011D73B467B13CE5E69D41 ['2018-10-12T23:53:34',
 '2018-10-17T09:48:31']

 >
 > > > * the exact measurement times for a relay with multiple measurements
 that fails the test?
 > >
 > > Attachment
 > > All from today, hmm?
 >
 > Let's just focus on a single relay.

 Relay with 3 results that discards 1 result:

 241C0134A6F62F40D378562B348531E51B946A07 Results NOT away from each other
 at least 86400s: 2018-10-17T15:51:23, 2018-10-17T15:51:04
 Final results ts: ['2018-10-13T22:02:00', '2018-10-17T15:51:23']

 Relay with 2 results that does not pass the test:

 D1352AECB24F050C54CA13A8BC84F9613E4E61FD  Results NOT away from each other
 at least 86400s:2018-10-17T11:58:17, 2018-10-17T11:57:47

 None of the relays with 1 result pass the test

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


More information about the tor-bugs mailing list