Merge branch 'maint-0.4.7'

This commit is contained in:
David Goulet 2022-10-11 10:09:37 -04:00
commit 4692cf8688
2 changed files with 13 additions and 1 deletions

7
changes/bug40673 Normal file
View File

@ -0,0 +1,7 @@
o Minor bugfixes (relay overload statistics):
- Count total create cells vs dropped rate cells properly, when
assessing if our fraction of dropped cells is too high. We only
count non-client circuits in the denominator, but we would include
client circuits in the numerator, leading to surprising log lines
claiming that we had dropped more than 100% of incoming create
cells. Fixes bug 40673; bugfix on 0.4.7.1-alpha.

View File

@ -36,6 +36,7 @@
#include "feature/stats/rephist.h" #include "feature/stats/rephist.h"
#include "core/or/or_circuit_st.h" #include "core/or/or_circuit_st.h"
#include "core/or/channel.h"
/** Type for a linked list of circuits that are waiting for a free CPU worker /** Type for a linked list of circuits that are waiting for a free CPU worker
* to process a waiting onion handshake. */ * to process a waiting onion handshake. */
@ -188,7 +189,11 @@ onion_pending_add(or_circuit_t *circ, create_cell_t *onionskin)
#define WARN_TOO_MANY_CIRC_CREATIONS_INTERVAL (60) #define WARN_TOO_MANY_CIRC_CREATIONS_INTERVAL (60)
static ratelim_t last_warned = static ratelim_t last_warned =
RATELIM_INIT(WARN_TOO_MANY_CIRC_CREATIONS_INTERVAL); RATELIM_INIT(WARN_TOO_MANY_CIRC_CREATIONS_INTERVAL);
rep_hist_note_circuit_handshake_dropped(queue_idx); if (!channel_is_client(circ->p_chan)) {
// Avoid counting create cells from clients, to go with the same
// check in command_process_create_cell().
rep_hist_note_circuit_handshake_dropped(queue_idx);
}
if (queue_idx == ONION_HANDSHAKE_TYPE_NTOR) { if (queue_idx == ONION_HANDSHAKE_TYPE_NTOR) {
char *m; char *m;
if ((m = rate_limit_log(&last_warned, approx_time()))) { if ((m = rate_limit_log(&last_warned, approx_time()))) {