[tor-bugs] #33784 [Core Tor/sbws]: Think about using `self._relays` in `_relays_with_flag()` and friends

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Apr 2 07:54:25 UTC 2020


#33784: Think about using `self._relays` in `_relays_with_flag()` and friends
---------------------------+------------------------
 Reporter:  gk             |          Owner:  (none)
     Type:  enhancement    |         Status:  new
 Priority:  Medium         |      Milestone:
Component:  Core Tor/sbws  |        Version:
 Severity:  Normal         |     Resolution:
 Keywords:                 |  Actual Points:
Parent ID:                 |         Points:
 Reviewer:                 |        Sponsor:
---------------------------+------------------------
Description changed by gk:

Old description:

> When we currently call `_relays_with_flag()` and friends the
> `self.relays` property might cause a refresh of relays. This works fine
> in general but is a) expensive and b) it causes hangs in unit tests in
> case one uses the property in without `freeze_time()` or even just
> instantiates a `RelayList`.
>
> We should think whether we can use `self._relays` instead. If not in
> every use case maybe it's possible to use it in some of those cases.

New description:

 When we currently call `_relays_with_flag()` and friends the `self.relays`
 property might cause a refresh of relays. This works fine in general but
 is a) expensive and b) it causes hangs in unit tests in case one uses the
 property without `freeze_time()` or even just instantiates a `RelayList`.

 We should think whether we can use `self._relays` instead. If not in every
 use case maybe it's possible to use it in some of those cases, though.

--

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


More information about the tor-bugs mailing list