[tor-bugs] #20579 [Metrics/Torflow]: TorCtl re-uses iterables, even though they only yield their items once
Tor Bug Tracker & Wiki
blackhole at torproject.org
Sat Nov 5 03:40:11 UTC 2016
#20579: TorCtl re-uses iterables, even though they only yield their items once
---------------------------------+--------------------
Reporter: teor | Owner: aagbsn
Type: defect | Status: new
Priority: Medium | Milestone:
Component: Metrics/Torflow | Version:
Severity: Major | Keywords:
Actual Points: | Parent ID:
Points: | Reviewer:
Sponsor: |
---------------------------------+--------------------
When TorCtl calls filter(), it often re-uses the iterable multiple times.
But python iterables only yield each item once.
To fix this, we need to turn iterables we want to re-use into a list,
using list(filter()).
This might just be why a lot of nodes remain unmeasured, or measurement is
unreliable. In our test network, it seems to have caused only 5-7/15 nodes
to be measured.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/20579>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list