Opened 7 years ago

Closed 7 years ago

#7038 closed defect (fixed)

command_process_create_cell() rate_limit_log is pointless

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

Description

In command_process_create_cell() we have

    if (assign_onionskin_to_cpuworker(NULL, circ, onionskin) < 0) {
#define WARN_HANDOFF_FAILURE_INTERVAL (6*60*60)
      static ratelim_t handoff_warning =
        RATELIM_INIT(WARN_HANDOFF_FAILURE_INTERVAL);
      char *m;
      if ((m = rate_limit_log(&handoff_warning, approx_time()))) {
        log_warn(LD_GENERAL,"Failed to hand off onionskin. Closing.%s",m);
        tor_free(m);
      }

We rate-limited it to every six hours. But the typical case for triggering it happens in onion_pending_add() which has its own log:

  if (ol_length >= get_options()->MaxOnionsPending) {
#define WARN_TOO_MANY_CIRC_CREATIONS_INTERVAL (60)
    static ratelim_t last_warned =
      RATELIM_INIT(WARN_TOO_MANY_CIRC_CREATIONS_INTERVAL);
    char *m;
    if ((m = rate_limit_log(&last_warned, approx_time()))) {
      log_warn(LD_GENERAL,
               "Your computer is too slow to handle this many circuit "
               "creation requests! Please consider using the "
               "MaxAdvertisedBandwidth config option or choosing a more "
               "restricted exit policy.%s",m);
      tor_free(m);
    }

rate-limited to just once per minute.

I think we should downgrade the outer log message and remove the rate limiting cruft.

Child Tickets

Change History (3)

comment:1 Changed 7 years ago by arma

See https://trac.torproject.org/projects/tor/ticket/1042#comment:3 for when we first noticed this issue (and could have fixed it then, but I guess we didn't).

comment:2 Changed 7 years ago by arma

Status: newneeds_review

my branch bug7038

comment:3 Changed 7 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Looks okay by me. Merging.

Note: See TracTickets for help on using tickets.