From 65c0489dd4f0e10230f5c2fbb772a58e03e939bb Mon Sep 17 00:00:00 2001 From: Mike Perry Date: Tue, 26 Mar 2013 20:28:19 -0700 Subject: [PATCH 1/4] Bug 6572: Use timestamp_created for liveness sanity checks. This should eliminate potential regressions caused by #7341. --- src/or/circuituse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/or/circuituse.c b/src/or/circuituse.c index f02597e630..14576f13d6 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -671,7 +671,7 @@ circuit_expire_building(void) circuit_purpose_to_string(victim->purpose)); } else if (circuit_build_times_count_close(&circ_times, first_hop_succeeded, - victim->timestamp_began.tv_sec)) { + victim->timestamp_created.tv_sec)) { circuit_build_times_set_timeout(&circ_times); } } From fc9a72c6886c83f96f0b322dab92dbc3c5a8f26b Mon Sep 17 00:00:00 2001 From: Mike Perry Date: Tue, 26 Mar 2013 20:29:41 -0700 Subject: [PATCH 2/4] Changes file for bug6572. --- changes/bug6572 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changes/bug6572 diff --git a/changes/bug6572 b/changes/bug6572 new file mode 100644 index 0000000000..6508d1bcb5 --- /dev/null +++ b/changes/bug6572 @@ -0,0 +1,4 @@ + o Minor bugfixes (log messages) + - Use circuit creation time for network liveness evaluation. This + should eliminate warning log messages about liveness caused by + changes in timeout evaluation. Fixes bug 6572; bugfix on 0.2.4.8-alpha. From 87d50d0617d89290ca263aa6f415e45a0c37a11a Mon Sep 17 00:00:00 2001 From: Mike Perry Date: Wed, 27 Mar 2013 16:22:43 -0700 Subject: [PATCH 3/4] Clarify liveness log message and lower it to notice. It could just be due to small clock jumps, after all. --- src/or/circuitstats.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/or/circuitstats.c b/src/or/circuitstats.c index fe9c80ddce..1d7812bf2b 100644 --- a/src/or/circuitstats.c +++ b/src/or/circuitstats.c @@ -1232,11 +1232,11 @@ circuit_build_times_network_close(circuit_build_times_t *cbt, format_local_iso_time(last_live_buf, cbt->liveness.network_last_live); format_local_iso_time(start_time_buf, start_time); format_local_iso_time(now_buf, now); - log_warn(LD_BUG, - "Circuit somehow completed a hop while the network was " - "not live. Network was last live at %s, but circuit launched " - "at %s. It's now %s.", last_live_buf, start_time_buf, - now_buf); + log_notice(LD_CIRC, + "A circuit somehow completed a hop while the network was " + "not live. The network was last live at %s, but the circuit " + "launched at %s. It's now %s. This could mean your clock " + "changed.", last_live_buf, start_time_buf, now_buf); } cbt->liveness.nonlive_timeouts++; if (cbt->liveness.nonlive_timeouts == 1) { From 7f8098d2d0e719f3ea9e35a7f930477f8fc7682a Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 27 Mar 2013 21:04:08 -0400 Subject: [PATCH 4/4] Add some missing case values to please clang It seems that some versions of clang that would prefer the -Wswitch-enum compiler flag to warn about switch statements with missing enum values, even if those switch statements have a default. Fixes bug 8598; bugfix on 0.2.4.10-alpha. --- changes/bug8598 | 6 ++++++ src/or/circuitbuild.c | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 changes/bug8598 diff --git a/changes/bug8598 b/changes/bug8598 new file mode 100644 index 0000000000..e31c8f3c74 --- /dev/null +++ b/changes/bug8598 @@ -0,0 +1,6 @@ + o Bugfixes: + - Fix compilation warning with some versions of clang that would prefer + the -Wswitch-enum compiler flag to warn about switch statements with + missing enum values, even if those switch statements have a default: + statement. Fixes bug 8598; bugfix on 0.2.4.10-alpha. + diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index ce552b47f4..aec6c6acf2 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2010,6 +2010,9 @@ pathbias_check_close(origin_circuit_t *ocirc, int reason) pathbias_count_use_failed(ocirc); break; + case PATH_STATE_NEW_CIRC: + case PATH_STATE_BUILD_ATTEMPTED: + case PATH_STATE_ALREADY_COUNTED: default: // Other states are uninteresting. No stats to count. break;