[tor-bugs] #2346 [Tor Client]: Failing to write state file means you try every second

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Tue Jan 4 04:58:24 UTC 2011


#2346: Failing to write state file means you try every second
------------------------+---------------------------------------------------
 Reporter:  arma        |       Owner:                    
     Type:  defect      |      Status:  new               
 Priority:  normal      |   Milestone:  Tor: 0.2.2.x-final
Component:  Tor Client  |     Version:                    
 Keywords:              |      Parent:                    
------------------------+---------------------------------------------------
 In or_state_save() we check
 {{{
   if (global_state->next_write > now)
     return 0;
 }}}
 but in the case where the save fails, we don't reset next_write. So we end
 up back in this function on the next second, failing to write again. That
 can't be good.

 I say we set next_write to now + 3600 in the normal case, or TIME_MAX if
 !AvoidDiskWrites is true. That way if it was a temporary problem it will
 for sure get retried pretty soon, but not that soon, and sooner if some
 other event happens that marks our state dirty again.

 Bug is on 0.2.1.x and earlier too, but I think we can get away just fine
 with fixing it in maint-0.2.2 and later.

 Bug pointed out by 'special' while hunting down #2077.

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


More information about the tor-bugs mailing list