Commit Graph

330 Commits

Author SHA1 Message Date
David Goulet b9de73e46e cpu: Set number of threads to number of cores
Cap this to 2 threads always because we need a low and high priority
thread even with a single core.

Fixes #40713

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-11-23 13:52:36 -05:00
David Goulet 560d44b08b Merge branch 'maint-0.4.7' 2022-11-09 15:29:04 -05:00
David Goulet e3f6908984 relay: Make the max pending tasks per CPU a consensus parameter
Until now, there was this magic number (64) used as the maximum number
of tasks a CPU worker can take at once.

This commit makes it a consensus parameter so our future selves can
think of a better value depending on network conditions.

Part of #40704

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-11-09 13:13:21 -05:00
David Goulet 8b8873b759 Merge branch 'maint-0.4.7' 2022-11-08 15:26:44 -05:00
David Goulet 5b0103cfb4 Merge branch 'tor-gitlab/mr/651' into maint-0.4.7 2022-11-08 15:25:08 -05:00
David Goulet d634a5ebc7 relay: Remove unused conn->ext_or_conn_id
This also incidently removes a use of uninitialized stack data from the
connection_or_set_ext_or_identifier() function.

Fixes #40648

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-11-08 12:35:09 -05:00
David Goulet 6196e9596a metrics: Add connection socket family to metrics
Adds either ipv4 or ipv6 to the "tor_relay_connections_total" stats.

Closes #40710

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-11-03 13:05:21 -04:00
David Goulet c733ccda99 Merge branch 'tor-gitlab/mr/579' 2022-10-31 15:28:36 -04:00
David Goulet 5080a4ff67 Merge branch 'maint-0.4.7' 2022-10-12 15:52:04 -04:00
David Goulet c8d8fa0d36 relay: Add number of rejected connections to MetricsPort
Related to #40194

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-12 09:25:19 -04:00
David Goulet 5603baf257 conn: Keep stats of opened and closed connections
Related to #40194

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-12 09:25:19 -04:00
David Goulet b7f9a24c08 relay: Remove unused conn->ext_or_conn_id
This also incidently removes a use of uninitialized stack data from the
connection_or_set_ext_or_identifier() function.

Fixes #40648

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-07-26 11:56:33 -04:00
Alex Xu (Hello71) b65ffa6f06 Enable IP_BIND_ADDRESS_NO_PORT if supported 2022-06-15 08:35:40 -04:00
David Goulet b733f9d6ac Merge branch 'maint-0.4.7' 2022-06-02 16:11:04 -04:00
Mike Perry 9769b77c9b Demote log message to info.
This log is harmless, and can be common at relays if clients are sending XOFF.
2022-06-02 18:48:14 +00:00
Alex Xu (Hello71) 87b2ce6f84 Trigger OOS on bind failures (fixes #40597) 2022-05-21 21:30:06 -04:00
Alex Xu (Hello71) 15e95c3bda Use tor_event_free instead of event_del+tor_free
Using tor_free is wrong; event_free must be called for objects obtained from
event_new. Additionally, this slightly simplifies the code.

Also, add a static_assert to prevent further instances.
2022-04-20 00:14:25 -04:00
Mike Perry b2553bfba2 Use path type hint for Vegas queue parameters.
These parameters will vary depending on path length, especially for onions.
2022-02-22 19:28:35 +00:00
Mike Perry b6d5fbba7d Implement congestion control parameter negotiation 2022-02-22 19:28:34 +00:00
Nick Mathewson 93318ba5e2 Convert TODO into TODO-324 for better visibility. 2022-02-22 19:28:33 +00:00
Nick Mathewson a511718a30 Negotiated circuit parameters must pass from worker. 2022-02-22 19:28:33 +00:00
Nick Mathewson 244444e8b1 Add an exported struct to onion handshakes for circuits params
THis will eventually hold the congestion control parameters that we
negotiated, plus whatever else is relevant.
2022-02-22 19:28:33 +00:00
Nick Mathewson 358ce9a19d Add a size argument for the buffer on onion handshake functions 2022-02-22 19:28:33 +00:00
Mike Perry 0422eb26a7 Prop#324: Hook up flow control 2021-10-04 10:45:46 -04:00
David Goulet 819b69244a Support rate limiting of edge connections reads.
We only need to rate limit reading on edges for flow control, as per the rate
that comes in the XON from the other side. When we rate limit reading from the
edge source to this rate, we will only deliver that fast to the other side,
thus satisfying its rate request.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-04 10:45:46 -04:00
Mike Perry 5c3021be85 Make inbuf and outbuf len check params const 2021-07-30 12:57:31 -04:00
George Kadianakis 30a97d9bb3 Increase frequency of vg-lite callback to 15 minutes 2021-07-20 13:03:32 +03:00
George Kadianakis 314a6b42c5 Introduce vanguards-lite subsystem and some of its entry points
Co-authored-by: Mike Perry <mikeperry-git@torproject.org>
2021-07-01 18:15:55 +03:00
Nick Mathewson af560f21ec Merge branch 'maint-0.4.6' 2021-05-17 09:04:22 -04:00
Nick Mathewson fbd47a5078 Merge branch 'maint-0.4.5' into maint-0.4.6 2021-05-17 09:04:22 -04:00
David Goulet 5f009a59da conn: MetricsPort listener is a listener port
The connection type for the listener part was missing from the "is
connection a listener" function.

This lead to our periodic event that retries our listeners to keep
trying to bind() again on an already opened MetricsPort.

Closes #40370

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 15:13:50 -04:00
David Goulet 22861c2f40 relay: Add TCP port exhaustion metrics
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 11:58:25 -04:00
Roger Dingledine 962b15aa6f fix some tiny typos 2021-03-24 18:13:46 -04:00
George Kadianakis 29f07a4e9d Merge branch 'mr/334' 2021-03-17 18:23:18 +02:00
George Kadianakis e688580277 Implement rate limiting metrics. 2021-03-17 18:22:38 +02:00
George Kadianakis faf1fe833e Implement port/file-descriptor exhaustion metric.
This uses a heuristic that came up after a discussion with David.

I'm leaving this as a separate commit so that it can be discussed further if
needed.
2021-03-17 18:22:38 +02:00
David Goulet 15a95df376 Merge branch 'tor-gitlab/mr/337' 2021-03-17 11:53:14 -04:00
Nick Mathewson 066748c9cd Add a DormantTimeoutEnabled to disable dormant mode entirely
(If you need to do this in an older version you can just set
DormantClientTimeout to something huge.)

Closes #40228.
2021-03-17 11:53:09 -04:00
Nick Mathewson b5d08ddc09 Update copyrights to 2021, using "make update-copyright" 2021-03-12 11:39:23 -05:00
David Goulet 38649b4f95 relay: Remove dirport reachability self test
Regular relays are about to get their DirPort removed so that reachability
test is not useful anymore

Authorities will still use the DirPort but because network reentry towards
their DirPort is now denied network wide, this test is not useful anymore and
so it should simply be considered reachable at all time.

Part of #40282

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-22 08:52:06 -05:00
David Goulet 2c865542b6 hs-v2: Removal of service and relay support
This is unfortunately massive but both functionalities were extremely
intertwined and it would have required us to actually change the HSv2 code in
order to be able to split this into multiple commits.

After this commit, there are still artefacts of v2 in the code but there is no
more support for service, intro point and HSDir.

The v2 support for rendezvous circuit is still available since that code is
the same for the v3 and we will leave it in so if a client is able to
rendezvous on v2 then it can still transfer traffic. Once the entire network
has moved away from v2, we can remove v2 rendezvous point support.

Related to #40266

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-19 13:20:48 -05:00
David Goulet 2444629c86 hs-v2: Remove client support
Related to #40266

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-19 13:19:08 -05:00
George Kadianakis cf1f03fe1d Merge remote-tracking branch 'tor-gitlab/mr/308' 2021-02-19 13:25:47 +02:00
David Goulet 9f61d9238c metrics: Handle the connection finished flushing event
Turns out, we forgot to add the METRICS connection type fo the finished
flushing handler.

Fixes #40295

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-17 09:54:05 -05:00
Nick Mathewson d6b82d79dc Merge branch 'maint-0.4.5' 2021-02-08 14:28:19 -05:00
David Goulet 01c4abc2d4 conn: Properly close MetricsPort socket on EOF
Handle the EOF situation for a metrics connection. Furthermore, if we failed
to fetch the data from the inbuf properly, mark the socket as closed because
the caller, connection_process_inbuf(), assumes that we did so on error.

Fixes #40257

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-08 14:26:45 -05:00
Neel Chauhan a82b4eb305 src/core/mainloop: Put brackets around IPv6 addresses in log messages 2021-01-27 08:23:39 -08:00
George Kadianakis 42e95c8d85 Merge branch 'maint-0.4.5' 2021-01-12 18:05:32 +02:00
David Goulet 9b59ede8d3 Merge branch 'ticket40237_044_01' into ticket40237_045_01 2021-01-12 10:55:21 -05:00
David Goulet b3652f2104 Merge branch 'ticket40237_043_01' into ticket40237_044_01 2021-01-12 10:54:31 -05:00