aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-04-11 01:42:54 -0400
committerNick Mathewson <nickm@torproject.org>2013-04-11 01:42:54 -0400
commitee3cc44f27b6620ad25a20bb16fcffe23ca66663 (patch)
tree4123415471a14f6cdfbb34992bccec4cd5297276
parent7f50af116f2497a73fe9113e814a5765047cf3ca (diff)
parent805ecb8719e5e66d708f040027fecc6de56b3a5b (diff)
downloadtor-ee3cc44f27b6620ad25a20bb16fcffe23ca66663.tar.gz
tor-ee3cc44f27b6620ad25a20bb16fcffe23ca66663.zip
Merge remote-tracking branch 'public/bug7302' into maint-0.2.4
Conflicts: src/or/status.c
-rw-r--r--changes/bug730211
-rw-r--r--src/or/control.c3
-rw-r--r--src/or/status.c11
3 files changed, 21 insertions, 4 deletions
diff --git a/changes/bug7302 b/changes/bug7302
new file mode 100644
index 0000000000..fec615ff90
--- /dev/null
+++ b/changes/bug7302
@@ -0,0 +1,11 @@
+ o Minor bugfixes:
+ - Don't log inappropriate heartbeat messages when hibernating: a
+ hibernating node is _expected_ to drop out of the consensus,
+ decide it isn't bootstrapped, and so forth. Fixes part of bug
+ 7302; bugfix on 0.2.3.1-alpha.
+
+ - Don't complain about bootstrapping problems while hibernating.
+ These complaints reflect a general code problems, but not one
+ with any problematic effects. (No connections are actually
+ opened.) Fixes part of bug 7302; bugfix on 0.2.3.2-alpha.
+
diff --git a/src/or/control.c b/src/or/control.c
index f50b87711c..390b8d1502 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -4715,6 +4715,9 @@ control_event_bootstrap_problem(const char *warn, int reason)
!any_pending_bridge_descriptor_fetches())
recommendation = "warn";
+ if (we_are_hibernating())
+ recommendation = "ignore";
+
while (status>=0 && bootstrap_status_to_string(status, &tag, &summary) < 0)
status--; /* find a recognized status string based on current progress */
status = bootstrap_percent; /* set status back to the actual number */
diff --git a/src/or/status.c b/src/or/status.c
index e44de635cb..d239e6ee75 100644
--- a/src/or/status.c
+++ b/src/or/status.c
@@ -14,6 +14,7 @@
#include "router.h"
#include "circuitlist.h"
#include "main.h"
+#include "hibernate.h"
/** Return the total number of circuits. */
static int
@@ -86,11 +87,12 @@ log_heartbeat(time_t now)
char *uptime = NULL;
const routerinfo_t *me;
double r = tls_get_write_overhead_ratio();
+ const int hibernating = we_are_hibernating();
const or_options_t *options = get_options();
(void)now;
- if (public_server_mode(options)) {
+ if (public_server_mode(options) && !hibernating) {
/* Let's check if we are in the current cached consensus. */
if (!(me = router_get_my_routerinfo()))
return -1; /* Something stinks, we won't even attempt this. */
@@ -105,10 +107,11 @@ log_heartbeat(time_t now)
bw_sent = bytes_to_usage(get_bytes_written());
log_fn(LOG_NOTICE, LD_HEARTBEAT, "Heartbeat: Tor's uptime is %s, with %d "
- "circuits open. I've sent %s and received %s.",
- uptime, count_circuits(),bw_sent,bw_rcvd);
+ "circuits open. I've sent %s and received %s.%s",
+ uptime, count_circuits(),bw_sent,bw_rcvd,
+ hibernating?" We are currently hibernating.":"");
- if (stats_n_data_cells_packaged)
+ if (stats_n_data_cells_packaged && !hibernating)
log_notice(LD_HEARTBEAT, "Average packaged cell fullness: %2.3f%%",
100*(U64_TO_DBL(stats_n_data_bytes_packaged) /
U64_TO_DBL(stats_n_data_cells_packaged*RELAY_PAYLOAD_SIZE)) );