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 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
befbde1
Add ALPN field to listener config, change listener builder
Wonshtrum Aug 10, 2023
b11de16
Add h2 flag to frontends and in Router
Wonshtrum Aug 11, 2023
86213e8
Mux SessionState (test)
Wonshtrum Aug 14, 2023
838794c
Mutualize socket_read at the beginning of Mux::readable with an "expe…
Wonshtrum Aug 16, 2023
1ad3514
Add mechanisms to handle H2 frames
Wonshtrum Aug 17, 2023
d140e96
Remork Streams
Wonshtrum Aug 21, 2023
fa2ca5e
Continue frame handling:
Wonshtrum Aug 22, 2023
5a18f93
Split mux in h1 and h2 files
Wonshtrum Aug 22, 2023
12c5080
Define MuxResult for inter MuxSession control flow
Wonshtrum Aug 22, 2023
0a3459b
Front to Back:
Wonshtrum Aug 23, 2023
e51421f
Maintenance:
Wonshtrum Aug 24, 2023
96a6d3a
PoC: pass proxied endpoints to proxy functions through trait
Wonshtrum Aug 24, 2023
8b98da5
Insert writable readiness in opposit endpoint upon receiving proxyabl…
Wonshtrum Aug 25, 2023
618fdb2
First H2<->H1 round trip!
Wonshtrum Aug 25, 2023
fc849bd
Fix H1 round trip:
Wonshtrum Aug 28, 2023
61865b2
H2 header fixes:
Wonshtrum Aug 28, 2023
6f4571b
H2<->H2 Settings handshake
hcaumeil Aug 28, 2023
4f01cd9
Mux routing:
Wonshtrum Aug 30, 2023
f7a7558
Set default RulePosition to Tree when parsing config.toml
Wonshtrum Aug 31, 2023
691616f
H2 client endpoint:
Wonshtrum Aug 31, 2023
43ee66e
h2 improvments:
Wonshtrum Sep 4, 2023
9deb6b5
Error handling:
Wonshtrum Sep 6, 2023
6d602f0
Error handling and connection retry:
Wonshtrum Sep 9, 2023
5e888d0
Proxying enhancements:
Wonshtrum Sep 12, 2023
d13eb0d
Use Mux State in HTTP Session:
Wonshtrum Sep 19, 2023
c0129fe
H2 Continuation frames for Headers
Wonshtrum Sep 25, 2023
388a3e2
Add settings for connect protocol and no RFC 7540 priorities
Wonshtrum Sep 27, 2023
ed56c8b
Introduce timeouts in Mux State
Wonshtrum Sep 29, 2023
eb46c00
Make gRPC work through Mux!
Wonshtrum Sep 29, 2023
a5fedf7
Properly deregister backends from slab and mio
Wonshtrum Oct 18, 2023
e64cf6b
Remove debugging println
Wonshtrum Apr 22, 2024
58d90d9
Making Mux working again after rebase
Wonshtrum May 2, 2024
001b792
Flag h2 at config level not frontend level
Wonshtrum May 7, 2024
f1f9afc
Use static dispatch for ProxyL7 and L7ListenerHandler
Wonshtrum May 13, 2024
de22a00
Move session_address, public_address and sticky_name around
Wonshtrum May 13, 2024
bc27e25
h2spec ETA: 113/147
Wonshtrum May 22, 2024
9bc8157
h2spec ETA: 135/147
Wonshtrum May 23, 2024
85fe0df
h2spec ETA: 140/147
Wonshtrum May 30, 2024
c336698
Update metrics, backend status and events
Wonshtrum Jun 12, 2024
3d04306
Performance and stability improvements
Wonshtrum Jun 20, 2024
8a2a712
release: v1.1.0-rc.0
Keksoj Jul 19, 2024
6507da3
release: v1.1.0-rc.1
Keksoj Jul 25, 2024
f7af2c4
Various enhancements for test and release
Wonshtrum Oct 16, 2024
087f631
release: v1.1.0-rc.2
Wonshtrum Oct 29, 2024
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
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.4"
version = "1.1.0-rc.2"
license = "AGPL-3.0"
authors = [
"Geoffroy Couprie <[email protected]>",
Expand Down Expand Up @@ -34,8 +34,8 @@ tempfile = "^3.10.1"
termion = "^4.0.0"
thiserror = "^1.0.61"

sozu-command-lib = { path = "../command", version = "^1.0.4" }
sozu-lib = { path = "../lib", version = "^1.0.4" }
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
10 changes: 9 additions & 1 deletion bin/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ pub enum SubCmd {
#[clap(subcommand)]
cmd: ConfigCmd,
},
#[clap(name = "events", about = "receive sozu events about the status of backends")]
#[clap(
name = "events",
about = "receive sozu events about the status of backends"
)]
Events,
}

Expand Down Expand Up @@ -296,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.4"
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