[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-bugs] #8607 [Stem]: Controller's cache isn't thread safe
#8607: Controller's cache isn't thread safe
-----------------------------+----------------------------------------------
Reporter: atagar | Owner: atagar
Type: defect | Status: new
Priority: normal | Milestone:
Component: Stem | Version:
Keywords: controller easy | Parent:
Points: | Actualpoints:
-----------------------------+----------------------------------------------
The Controller's _request_cache attribute isn't used in a thread safe
manner. Once upon a time we only added to it so this wasn't an issue, but
now that we're doing cache invalidation we need to be more careful. For
instance...
{{{
# check for cached results
for param in list(lookup_params):
cache_key = "getconf.%s" % param.lower()
if cache_key in self._request_cache:
reply[param] = self._request_cache[cache_key]
lookup_params.remove(param)
}}}
Querying and changing the cache should be under methods that acquire a
cache lock.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/8607>
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