[tor-bugs] #13806 [Tor]: Count HSDir storage towards MaxMemInQueues

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Jan 7 18:56:50 UTC 2015


#13806: Count HSDir storage towards MaxMemInQueues
------------------------+-------------------------------------------
     Reporter:  nickm   |      Owner:
         Type:  defect  |     Status:  needs_review
     Priority:  normal  |  Milestone:  Tor: 0.2.6.x-final
    Component:  Tor     |    Version:
   Resolution:          |   Keywords:  tor-relay tor-hs oom security
Actual Points:          |  Parent ID:
       Points:          |
------------------------+-------------------------------------------

Comment (by dgoulet):

 * I would add a comment on top of this {{{if (rend_cache_total >
 get_options()->MaxMemInQueues / 5)}}} to  document that if the rend cache
 is more than 20% of our memory limit, then cut it down to 10%. It's just
 not that clear right now why the "/ 5".

 * {{{rend_cache_total - (get_options()->MaxMemInQueues / 10) );}}}, extra
 space at the end?

 * I think I would put {{{rend_cache_total_allocation +=
 rend_cache_entry_allocation(e);}}} in a function name something like
 "rend_cache_increment_allocation(e)" (which also follow the _decrement
 naming) in which overflow could be handled. Also, for possible future work
 of multi thread in tor, always good to have global variable updated in a
 single call site. If you prefer that way,
 {{{rend_cache_get_total_allocation}}} should at least be used.

 * {{{last_served_cutoff += 1800;}}}, this "1800" value, arbitrary or comes
 from somewhere? Maybe a define for it?

 The rest looks good!

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


More information about the tor-bugs mailing list