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

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Apr 27 16:39:29 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:                
-----------------------------+----------------------------------------------

Comment(by axitkhurana):

 > 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).
 >

 How about adding an extra parameter for case insensitivity in get and set
 cache functions, wouldn't that handle both case sensitive and insensitive
 lookups, remove duplicate code?

 It would look something like this:

 {{{
 def _set_cache(self, params, case_insensitive=False, func=None):
   ....
     if case_insensitive:
       param = param.lower()
   ....
 }}}

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


More information about the tor-bugs mailing list