[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-bugs] #20579 [Metrics/Torflow]: TorCtl re-uses iterables, even though they only yield their items once
#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
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs