Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#3012 closed defect (fixed)

relays don't ever checkpoint their state file

Reported by: arma Owned by: arma
Priority: High Milestone: Tor: 0.2.2.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-relay
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

The calls to or_state_mark_dirty() are:

  • When you change your onion key
  • Every n client circuits you build
  • When you write out bandwidth accounting info (which happens on hup and when you begin hibernation or go dormant)
  • When you're exiting
  • When you add/remove an entry guard or one of your entry guards changes state

There's no regular checkpoint though. Which means you could go many days without writing it, and for relays now that we've added #1863 we might want that.

One fix would be to change

  global_state->next_write = TIME_MAX;

in or_state_save() to pick something like a day rather than TIME_MAX.

Child Tickets

Change History (6)

comment:1 Changed 8 years ago by arma

I'll do a patch, but first: should we make this change for everybody or only if you're a relay/bridge?

comment:2 Changed 8 years ago by arma

Owner: set to arma
Priority: normalmajor
Status: newassigned

I think it should only be relays, and it should be a daily checkpoint.

comment:3 Changed 8 years ago by arma

Status: assignedneeds_review

See my bug3012 branch.

I picked twice-a-day rather than daily, because if you crash an average of 12 hours after you wrote your state file, you'll lose lots of juicy stuff.

comment:4 Changed 8 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

The bikeshed shall be cleaned every 12 hours, huh?

Merged & closing.

comment:5 Changed 7 years ago by nickm

Keywords: tor-relay added

comment:6 Changed 7 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.