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

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Apr 27 14:19:12 UTC 2013


#8607: Controller's cache isn't thread safe
-----------------------------+----------------------------------------------
 Reporter:  atagar           |          Owner:  atagar        
     Type:  defect           |         Status:  needs_revision
 Priority:  normal           |      Milestone:                
Component:  Stem             |        Version:                
 Keywords:  controller easy  |         Parent:                
   Points:                   |   Actualpoints:                
-----------------------------+----------------------------------------------
Changes (by atagar):

  * status:  needs_review => needs_revision


Comment:

 Hi Akshit. I'm really sorry about the delay. Most mornings what limited
 time I have for tor stuff has been gobbled up by GSoC correspondence.

 {{{
 +        cache_params = {}
 }}}

 Lets rename 'cache_params' to 'to_cache' so its purpose is a little
 clearer.

 {{{
      # Config options are case insensitive and don't contain whitespace.
 Using
      # strip so the following check will catch whitespace-only params.

 -    param = param.lower().strip()
 +    param = param.strip()
 }}}

 I'd rather if we didn't move case insensitivity into the cache lookup
 helper. It's quite possible that we'll want case sensitive lookups later,
 the caveat that I brought up was that GETCONF and GETINFO queries are case
 insensitive. This is really the only gotcha I see (ready to push once this
 is changed).

 > I've added another function for single key, similar to get_conf_map and
 get_conf. Is this the best way of handling single, multiple params?

 Yup, that looks perfect! I was going to suggest an isinstance() check so
 we could overload the method but on reflection I like your solution
 better.

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


More information about the tor-bugs mailing list