Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: introduce multiplexed SessionState to handle heterogeneous HTTP Sessions #1104

Open
wants to merge 48 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
f68a5c7
Add ALPN field to listener config, change listener builder
Wonshtrum Aug 10, 2023
c7a9d95
Add h2 flag to frontends and in Router
Wonshtrum Aug 11, 2023
930ab18
Mux SessionState (test)
Wonshtrum Aug 14, 2023
2487621
Mutualize socket_read at the beginning of Mux::readable with an "expe…
Wonshtrum Aug 16, 2023
e624d7d
Add mechanisms to handle H2 frames
Wonshtrum Aug 17, 2023
1d99fad
Remork Streams
Wonshtrum Aug 21, 2023
f2e5990
Continue frame handling:
Wonshtrum Aug 22, 2023
565af71
Split mux in h1 and h2 files
Wonshtrum Aug 22, 2023
7606858
Define MuxResult for inter MuxSession control flow
Wonshtrum Aug 22, 2023
6b96635
Front to Back:
Wonshtrum Aug 23, 2023
4f92b63
Maintenance:
Wonshtrum Aug 24, 2023
3582d3b
PoC: pass proxied endpoints to proxy functions through trait
Wonshtrum Aug 24, 2023
20bf570
Insert writable readiness in opposit endpoint upon receiving proxyabl…
Wonshtrum Aug 25, 2023
9eba868
First H2<->H1 round trip!
Wonshtrum Aug 25, 2023
24b4995
Fix H1 round trip:
Wonshtrum Aug 28, 2023
5050ef1
H2 header fixes:
Wonshtrum Aug 28, 2023
6c683d2
H2<->H2 Settings handshake
hcaumeil Aug 28, 2023
e81c128
Mux routing:
Wonshtrum Aug 30, 2023
e44e372
Set default RulePosition to Tree when parsing config.toml
Wonshtrum Aug 31, 2023
2fe65db
H2 client endpoint:
Wonshtrum Aug 31, 2023
d5b4fe7
h2 improvments:
Wonshtrum Sep 4, 2023
31a95c1
Error handling:
Wonshtrum Sep 6, 2023
b693302
Error handling and connection retry:
Wonshtrum Sep 9, 2023
b5e1fe3
Proxying enhancements:
Wonshtrum Sep 12, 2023
19237ce
Use Mux State in HTTP Session:
Wonshtrum Sep 19, 2023
e3c68f6
H2 Continuation frames for Headers
Wonshtrum Sep 25, 2023
afb9732
Add settings for connect protocol and no RFC 7540 priorities
Wonshtrum Sep 27, 2023
28f0740
Introduce timeouts in Mux State
Wonshtrum Sep 29, 2023
f126fff
Make gRPC work through Mux!
Wonshtrum Sep 29, 2023
c4c465a
Properly deregister backends from slab and mio
Wonshtrum Oct 18, 2023
a87fb2e
Remove debugging println
Wonshtrum Apr 22, 2024
84b496d
Making Mux working again after rebase
Wonshtrum May 2, 2024
fb909a6
Flag h2 at config level not frontend level
Wonshtrum May 7, 2024
cfb27ea
Use static dispatch for ProxyL7 and L7ListenerHandler
Wonshtrum May 13, 2024
87b30b5
Move session_address, public_address and sticky_name around
Wonshtrum May 13, 2024
41c080c
h2spec ETA: 113/147
Wonshtrum May 22, 2024
07f5ea2
h2spec ETA: 135/147
Wonshtrum May 23, 2024
ca63dd9
h2spec ETA: 140/147
Wonshtrum May 30, 2024
c7a0a0f
Update metrics, backend status and events
Wonshtrum Jun 12, 2024
1451e67
Performance and stability improvements
Wonshtrum Jun 20, 2024
233a556
release: v1.1.0-rc.0
Keksoj Jul 19, 2024
ed932fa
release: v1.1.0-rc.1
Keksoj Jul 25, 2024
a129756
Various enhancements for test and release
Wonshtrum Oct 16, 2024
9a3cc38
release: v1.1.0-rc.2
Wonshtrum Oct 29, 2024
d0a21ba
Fix h1 KeepAlive backend crashing on events
Wonshtrum Jan 9, 2025
e1cc9c0
Disconnect on handling frames from unknown streams
Wonshtrum Jan 20, 2025
ad8fb54
Respect peer MAX_FRAME_SIZE
Wonshtrum Jan 23, 2025
e24fcb5
Implement close notify in server close
Wonshtrum Jan 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
397 changes: 203 additions & 194 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repository = "https://github.com/sozu-proxy/sozu"
readme = "README.md"
documentation = "https://docs.rs/sozu"
homepage = "https://sozu.io"
version = "1.0.6"
version = "1.1.0-rc.2"
license = "AGPL-3.0"
authors = [
"Geoffroy Couprie <[email protected]>",
Expand Down Expand Up @@ -42,8 +42,8 @@ tempfile = "^3.13.0"
termion = "^4.0.3"
thiserror = "^2.0.3"

sozu-command-lib = { path = "../command", version = "^1.0.6" }
sozu-lib = { path = "../lib", version = "^1.0.6" }
sozu-command-lib = { path = "../command", version = "^1.1.0-rc.2" }
sozu-lib = { path = "../lib", version = "1.1.0-rc.2" }

[target.'cfg(target_os="linux")'.dependencies]
num_cpus = "^1.16.0"
Expand Down
3 changes: 2 additions & 1 deletion bin/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ frontends = [
# - weight: weight used by the load balancing algorithm
# - sticky-id: sticky session identifier
backends = [
{ address = "127.0.0.1:1026", backend_id = "the-backend-to-my-app" }
{ address = "127.0.0.1:1026", backend_id = "back26" },
{ address = "127.0.0.1:1027", backend_id = "back27" }
]

# this is an example of a routing configuration for the TCP proxy
Expand Down
5 changes: 5 additions & 0 deletions bin/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ pub enum ClusterCmd {
help = "Configures the load balancing policy. Possible values are 'roundrobin', 'random' or 'leastconnections'"
)]
load_balancing_policy: LoadBalancingAlgorithms,
#[clap(
long = "http2",
help = "the backends of this cluster use http2 prio-knowledge"
)]
h2: bool,
},
}

Expand Down
5 changes: 4 additions & 1 deletion bin/src/ctl/request_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ impl CommandManager {
send_proxy,
expect_proxy,
load_balancing_policy,
h2,
} => {
let proxy_protocol = match (send_proxy, expect_proxy) {
(true, true) => Some(ProxyProtocolConfig::RelayHeader),
Expand All @@ -164,7 +165,9 @@ impl CommandManager {
https_redirect,
proxy_protocol: proxy_protocol.map(|pp| pp as i32),
load_balancing: load_balancing_policy as i32,
..Default::default()
http2: h2,
load_metric: None,
answer_503: None,
})
.into(),
)
Expand Down
2 changes: 1 addition & 1 deletion command/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repository = "https://github.com/sozu-proxy/sozu"
readme = "README.md"
documentation = "https://docs.rs/sozu-command-lib"
homepage = "https://sozu.io"
version = "1.0.6"
version = "1.1.0-rc.2"
license = "LGPL-3.0"
authors = [
"Geoffroy Couprie <[email protected]>",
Expand Down
7 changes: 7 additions & 0 deletions command/src/command.proto
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ message HttpsListenerConfig {
// agains session tracking. Defaults to 4.
required uint64 send_tls13_tickets = 20;
optional CustomHttpAnswers http_answers = 21;
repeated AlpnProtocol alpn = 22;
}

// details of an TCP listener
Expand Down Expand Up @@ -366,6 +367,11 @@ enum TlsVersion {
TLS_V1_3 = 5;
}

enum AlpnProtocol {
Http11 = 0;
H2 = 1;
}

// A cluster is what binds a frontend to backends with routing rules
message Cluster {
required string cluster_id = 1;
Expand All @@ -376,6 +382,7 @@ message Cluster {
required LoadBalancingAlgorithms load_balancing = 5 [default = ROUND_ROBIN];
optional string answer_503 = 6;
optional LoadMetric load_metric = 7;
required bool http2 = 8;
}

enum LoadBalancingAlgorithms {
Expand Down
Loading
Loading