aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-12-26 10:05:45 -0500
committerNick Mathewson <nickm@torproject.org>2012-12-26 10:05:45 -0500
commit127cb39ffcacbcd99633671e92d299ef53bbac46 (patch)
tree191ea4d1c9e990d35e21938b64d3e6fcc84a429b /src/or
parent2e9be92cd7a3ca58d73f3bd127f97c08c21210e0 (diff)
downloadtor-127cb39ffcacbcd99633671e92d299ef53bbac46.tar
tor-127cb39ffcacbcd99633671e92d299ef53bbac46.tar.gz
Rate-limit "No circuits are opened" message to once-per-hour
mr-4 reports on #7799 that he was seeing it several times per second, which suggests that things had gone very wrong. This isn't a real fix, but it should make Tor usable till we can figure out the real issue.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/circuituse.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 57ecef1ee..c3495b440 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -478,13 +478,18 @@ circuit_expire_building(void)
}
continue;
} else {
- log_notice(LD_CIRC,
+ static ratelim_t relax_timeout_limit = RATELIM_INIT(3600);
+ char *m;
+ if ((m = rate_limit_log(&relax_timeout_limit, approx_time()))) {
+ log_notice(LD_CIRC,
"No circuits are opened. Relaxed timeout for "
"a circuit with channel state %s to %ldms. "
"However, it appears the circuit has timed out anyway. "
- "%d guards are live. ",
+ "%d guards are live. %s",
channel_state_to_string(victim->n_chan->state),
- (long)circ_times.close_ms, num_live_entry_guards(0));
+ (long)circ_times.close_ms, num_live_entry_guards(0), m);
+ tor_free(m);
+ }
}
}