[tor-bugs] #8607 [Stem]: Controller's cache isn't thread safe

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Mar 29 17:08:15 UTC 2013


#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


More information about the tor-bugs mailing list