aboutsummaryrefslogtreecommitdiff
path: root/src/feature/relay/onion_queue.c
AgeCommit message (Collapse)Author
2023-02-05Fix typosDimitris Apostolou
2022-11-23relay: Use the configured number of threads for worker work calculationDavid Goulet
We cap our number of CPU worker threads to at least 2 even if we have a single core. But also, before we used to always add one extra thread regardless of the number of core. This meant that we were off when re-using the get_num_cpus() function when calculating our onionskin work overhead because we were always off by one. This commit makes it that we always use the number of thread our actual thread pool was configured with. Fixes #40719 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-11-09relay: Cache onion queue parameters on consensus changeDavid Goulet
This is part of the fast path so we need to cache consensus parameters instead of querying it everytime we need to learn a value. Part of #40704 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-11-09relay: Add the onion_queue_wait_cutoff consensus paramDavid Goulet
Transform the hardcoded value ONIONQUEUE_WAIT_CUTOFF into a consensus parameter so we can control it network wide. Closes #40704 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-11-09relay: Make MaxOnionQueueDelay into a consensus paramDavid Goulet
Part of #40704 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-06Properly compute cell-drop overload fractionAndy
Patch to address #40673. An additional check has been added to onion_pending_add() in order to ensure that we avoid counting create cells from clients. In the cpuworker.c assign_onionskin_to_cpuworker method if total_pending_tasks >= max_pending_tasks and channel_is_client(circ->p_chan) returns false then rep_hist_note_circuit_handshake_dropped() will be called and rep_hist_note_circuit_handshake_assigned() will not be called. This causes relays to run into errors due to the fact that the number of dropped packets exceeds the total number of assigned packets. To avoid this situation a check has been added to onion_pending_add() to ensure that these erroneous calls to rep_hist_note_circuit_handshake_dropped() are not made. See the #40673 ticket for the conversation with armadev about this issue.
2022-03-15rephist: Introduce a fraction and period for overload onionskinDavid Goulet
This code was heavily reused from the previous DNS timeout work done in ticket #40491 that was removed afterall from our code. Closes #40560 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-02-22Handle other places that use onion handshake type valuesMike Perry
We want ntor and ntorv3 to use the same queues and stats.
2021-05-12relay: Add the onionskins processing metricsDavid Goulet
With this commit, a relay now emits metrics event on the MetricsPort related to how many onionskins were handled (processed or dropped) for each handshake type. Related to #40367 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-03-17Merge branch 'mr/334'George Kadianakis
2021-03-17Implement straightforward overload general metrics.George Kadianakis
- OOM metric - onionskin overload metric - DNS timeout metric
2021-03-12Update copyrights to 2021, using "make update-copyright"Nick Mathewson
2020-02-06onion_queue.c: use TAILQ_HEAD less confusingly.Nick Mathewson
When we use macro inline, clang-format likes to break it in the middle, which makes checkSpace get confused.
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-04-11Add an assertion to num_ntors_per_tap().Nick Mathewson
This should please coverity, and fix CID 1415721. It didn't understand that networkstatus_get_param() always returns a value between its minimum and maximum values.
2019-01-16Bump copyright date to 2019Nick Mathewson
2018-09-21Move the non-crypto parts of onion.c out of src/core/cryptoNick Mathewson
The parts for handling cell formats should be in src/core/or. The parts for handling onionskin queues should be in src/core/or. Only the crypto wrapper belongs in src/core/crypto.