diff options
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/channelpadding.c | 16 | ||||
-rw-r--r-- | src/or/control.c | 2 | ||||
-rw-r--r-- | src/or/main.c | 4 |
3 files changed, 16 insertions, 6 deletions
diff --git a/src/or/channelpadding.c b/src/or/channelpadding.c index f5248e8960..bed2489837 100644 --- a/src/or/channelpadding.c +++ b/src/or/channelpadding.c @@ -530,10 +530,20 @@ channelpadding_compute_time_until_pad_for_netflow(channel_t *chan) >= chan->next_padding_time_ms) { int64_t ms_until_pad_for_netflow = chan->next_padding_time_ms - long_now; + /* If the padding time is in the past, that means that libevent delayed + * calling the once-per-second callback due to other work taking too long. + * See https://bugs.torproject.org/22212 and + * https://bugs.torproject.org/16585. This is a systemic problem + * with being single-threaded, but let's emit a notice if this + * is long enough in the past that we might have missed a netflow window, + * and allowed a router to emit a netflow frame, just so we don't forget + * about it entirely.. */ +#define NETFLOW_MISSED_WINDOW (150000 - DFLT_NETFLOW_INACTIVE_KEEPALIVE_HIGH) if (ms_until_pad_for_netflow < 0) { - log_warn(LD_BUG, - "Channel padding timeout scheduled "I64_FORMAT"ms in the past. " - "Did the monotonic clock just jump?", + int severity = (ms_until_pad_for_netflow < -NETFLOW_MISSED_WINDOW) + ? LOG_NOTICE : LOG_INFO; + log_fn(severity, LD_OR, + "Channel padding timeout scheduled "I64_FORMAT"ms in the past. ", I64_PRINTF_ARG(-ms_until_pad_for_netflow)); return 0; /* Clock jumped: Send padding now */ } diff --git a/src/or/control.c b/src/or/control.c index 9454a7ab67..9bcf1ee364 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -6506,7 +6506,7 @@ monitor_owning_controller_process(const char *process_spec) msg); owning_controller_process_spec = NULL; tor_cleanup(); - exit(0); + exit(1); } } diff --git a/src/or/main.c b/src/or/main.c index 9699c8d381..cb24fd18c8 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -1556,7 +1556,7 @@ check_ed_keys_callback(time_t now, const or_options_t *options) generate_ed_link_cert(options, now, new_signing_key > 0)) { log_err(LD_OR, "Unable to update Ed25519 keys! Exiting."); tor_cleanup(); - exit(0); + exit(1); } } return 30; @@ -3168,7 +3168,7 @@ try_locking(const or_options_t *options, int err_if_locked) r = try_locking(options, 0); if (r<0) { log_err(LD_GENERAL, "No, it's still there. Exiting."); - exit(0); + exit(1); } return r; } |