Files
neon/proxy/src
Conrad Ludgate a56fd45f56 proxy: fix memory leak again (#5909)
## Problem

The connections.join_next helped but it wasn't enough... The way I
implemented the improvement before was still faulty but it mostly worked
so it looked like it was working correctly.

From [`tokio::select`
docs](https://docs.rs/tokio/latest/tokio/macro.select.html):
> 4. Once an <async expression> returns a value, attempt to apply the
value to the provided <pattern>, if the pattern matches, evaluate
<handler> and return. If the pattern does not match, disable the current
branch and for the remainder of the current call to select!. Continue
from step 3.

The `connections.join_next()` future would complete and `Some(Err(e))`
branch would be evaluated but not match (as the future would complete
without panicking, we would hope). Since the branch doesn't match, it's
disabled. The select continues but never attempts to call `join_next`
again. Getting unlucky, more TCP connections are created than we attempt
to join_next.

## Summary of changes

Replace the `Some(Err(e))` pattern with `Some(e)`. Because of the
auto-disabling feature, we don't need the `if !connections.is_empty()`
step as the `None` pattern will disable it for us.
2023-11-23 19:11:24 +00:00
..
2023-11-23 19:11:24 +00:00
2023-10-25 15:43:03 +01:00
2023-10-17 13:13:12 +01:00
2023-07-04 14:54:59 +01:00
2023-11-16 20:46:23 +00:00
2023-05-15 23:45:04 +02:00
2023-07-17 15:53:01 +01:00
2023-11-16 20:46:23 +00:00
2023-11-06 17:44:44 +00:00
2023-08-31 14:30:25 +03:00
2023-11-23 19:11:24 +00:00
2023-10-30 16:43:06 +00:00
2023-08-30 15:14:03 +01:00
2022-07-04 23:46:37 +03:00