Skip to content

Commit 74286f9

Browse files
authored
migrate to hyper v1 (#1428)
1 parent 826e820 commit 74286f9

File tree

8 files changed

+593
-219
lines changed

8 files changed

+593
-219
lines changed

Cargo.lock

+552-197
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+7-6
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ http = "0.2.12"
5555
httptest = "0.16.1"
5656
human_bytes = "0.4.3"
5757
humantime = "2.1.0"
58-
hyper = { version = "0.14", features = [ "full" ] }
59-
hyper-staticfile = "0.9.6"
58+
hyper = { version = "1", features = [ "full" ] }
59+
hyper-staticfile = "0.10.0"
6060
indicatif = { version = "0.17.8", features = ["rayon"] }
6161
itertools = "0.13.0"
6262
libc = "0.2"
@@ -76,7 +76,8 @@ rayon = "1.10.0"
7676
rand = { version = "0.8.5", features = ["min_const_gen", "small_rng"] }
7777
rand_chacha = "0.3.1"
7878
reedline = "0.33.0"
79-
reqwest = { version = "0.11", features = ["default", "blocking", "json", "stream"] }
79+
reqwest = { version = "0.12", features = ["default", "blocking", "json", "stream"] }
80+
reqwest11 = { package = "reqwest", version = "0.11", features = ["default", "blocking", "json", "stream"] }
8081
ringbuffer = "0.15.0"
8182
rusqlite = { version = "0.32" }
8283
rustls-pemfile = { version = "1.0.4" }
@@ -112,16 +113,16 @@ usdt = "0.5.0"
112113
uuid = { version = "1", features = [ "serde", "v4" ] }
113114

114115
# git
115-
dropshot = { git = "https://github.com/oxidecomputer/dropshot", branch = "main", features = [ "usdt-probes" ] }
116+
dropshot = { version = "0.12.0", features = [ "usdt-probes" ] }
116117
omicron-common = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }
117118
nexus-client = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }
118119
internal-dns = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }
119120
omicron-uuid-kinds = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }
120121
openapi-lint = { git = "https://github.com/oxidecomputer/openapi-lint", branch = "main" }
121122
oximeter = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }
122123
oximeter-producer = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }
123-
progenitor = { git = "https://github.com/oxidecomputer/progenitor", branch = "main" }
124-
progenitor-client = { git = "https://github.com/oxidecomputer/progenitor", branch = "main" }
124+
progenitor = "0.8.0"
125+
progenitor-client = "0.8.0"
125126

126127
# local path
127128
crucible = { path = "./upstairs" }

downstairs/src/repair.rs

+11-6
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ use std::path::PathBuf;
33
use std::sync::Arc;
44

55
use dropshot::ApiDescription;
6+
use dropshot::Body;
67
use dropshot::ConfigDropshot;
78
use dropshot::HandlerTaskMode;
89
use dropshot::HttpError;
910
use dropshot::HttpResponseOk;
1011
use dropshot::HttpServerStarter;
1112
use dropshot::RequestContext;
1213
use dropshot::{endpoint, Path};
13-
use http::{Response, StatusCode};
14-
use hyper::Body;
14+
use hyper::{Response, StatusCode};
1515
use schemars::JsonSchema;
1616
use serde::Deserialize;
1717

@@ -152,7 +152,9 @@ async fn get_extent_file(
152152
get_a_file(extent_path).await
153153
}
154154

155-
async fn get_a_file(path: PathBuf) -> Result<Response<Body>, HttpError> {
155+
async fn get_a_file(
156+
path: PathBuf,
157+
) -> Result<Response<dropshot::Body>, HttpError> {
156158
/*
157159
* Make sure our file is neither a link nor a directory.
158160
*/
@@ -181,13 +183,16 @@ async fn get_a_file(path: PathBuf) -> Result<Response<Body>, HttpError> {
181183
)
182184
})?;
183185

184-
let file_stream = hyper_staticfile::FileBytesStream::new(file);
186+
let file_access = hyper_staticfile::vfs::TokioFileAccess::new(file);
187+
let file_stream =
188+
hyper_staticfile::util::FileBytesStream::new(file_access);
189+
let body = Body::wrap(hyper_staticfile::Body::Full(file_stream));
185190
let content_type = "application/octet-stream".to_string();
186191

187192
Ok(Response::builder()
188193
.status(StatusCode::OK)
189-
.header(http::header::CONTENT_TYPE, content_type)
190-
.body(file_stream.into_body())?)
194+
.header(hyper::header::CONTENT_TYPE, content_type)
195+
.body(body)?)
191196
}
192197
}
193198

pantry/src/pantry.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ impl Pantry {
851851
"volume {} is no longer active!",
852852
volume_id
853853
)),
854-
http::StatusCode::GONE,
854+
hyper::StatusCode::GONE,
855855
format!("volume {} is no longer active!", volume_id),
856856
))
857857
} else {

upstairs/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ uuid.workspace = true
5353
aes-gcm-siv.workspace = true
5454
rand_chacha.workspace = true
5555
reqwest.workspace = true
56+
reqwest11.workspace = true
5657
crucible-workspace-hack.workspace = true
5758
nexus-client = { workspace = true, optional = true }
5859
internal-dns = { workspace = true, optional = true }

upstairs/src/downstairs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ pub(crate) struct Downstairs {
128128

129129
/// A reqwest client, to be reused when creating Nexus clients
130130
#[cfg(feature = "notify-nexus")]
131-
reqwest_client: reqwest::Client,
131+
reqwest_client: reqwest11::Client,
132132
}
133133

134134
/// State machine for a live-repair operation
@@ -300,7 +300,7 @@ impl Downstairs {
300300
ddef: None,
301301

302302
#[cfg(feature = "notify-nexus")]
303-
reqwest_client: reqwest::ClientBuilder::new()
303+
reqwest_client: reqwest11::ClientBuilder::new()
304304
.connect_timeout(std::time::Duration::from_secs(15))
305305
.timeout(std::time::Duration::from_secs(15))
306306
.build()

upstairs/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,7 @@ pub fn up_main(
18301830
#[cfg(feature = "notify-nexus")]
18311831
pub(crate) async fn get_nexus_client(
18321832
log: &Logger,
1833-
client: reqwest::Client,
1833+
client: reqwest11::Client,
18341834
target_addrs: &[SocketAddr],
18351835
) -> Option<nexus_client::Client> {
18361836
use internal_dns::resolver::Resolver;

workspace-hack/Cargo.toml

+18-6
Original file line numberDiff line numberDiff line change
@@ -118,54 +118,66 @@ zerocopy = { version = "0.7", features = ["derive", "simd"] }
118118
[target.x86_64-unknown-linux-gnu.dependencies]
119119
bitflags-dff4ba8e3ae991db = { package = "bitflags", version = "1" }
120120
dof = { version = "0.3", default-features = false, features = ["des"] }
121-
hyper = { version = "0.14", features = ["full"] }
121+
hyper-582f2526e08bb6a0 = { package = "hyper", version = "0.14", features = ["full"] }
122+
hyper-dff4ba8e3ae991db = { package = "hyper", version = "1", features = ["full"] }
123+
hyper-util = { version = "0.1", features = ["full"] }
122124
mio = { version = "1", features = ["net", "os-ext"] }
123125
once_cell = { version = "1", features = ["unstable"] }
124126
rustix = { version = "0.38", features = ["fs", "stdio", "termios"] }
125127
rustls = { version = "0.21", features = ["dangerous_configuration"] }
128+
rustls-pki-types = { version = "1", features = ["std"] }
126129
spin = { version = "0.9", default-features = false, features = ["once", "spin_mutex"] }
127130

128131
[target.x86_64-unknown-linux-gnu.build-dependencies]
129132
dof = { version = "0.3", default-features = false, features = ["des"] }
130-
hyper = { version = "0.14", features = ["full"] }
133+
hyper-582f2526e08bb6a0 = { package = "hyper", version = "0.14", features = ["full"] }
131134
mio = { version = "1", features = ["net", "os-ext"] }
132135
once_cell = { version = "1", features = ["unstable"] }
133136
rustix = { version = "0.38", features = ["fs", "stdio", "termios"] }
134137
rustls = { version = "0.21", features = ["dangerous_configuration"] }
138+
rustls-pki-types = { version = "1", features = ["std"] }
135139
spin = { version = "0.9", default-features = false, features = ["once", "spin_mutex"] }
136140

137141
[target.aarch64-apple-darwin.dependencies]
138-
hyper = { version = "0.14", features = ["full"] }
142+
hyper-582f2526e08bb6a0 = { package = "hyper", version = "0.14", features = ["full"] }
143+
hyper-dff4ba8e3ae991db = { package = "hyper", version = "1", features = ["full"] }
144+
hyper-util = { version = "0.1", features = ["full"] }
139145
mio = { version = "1", features = ["net", "os-ext"] }
140146
once_cell = { version = "1", features = ["unstable"] }
141147
rustix = { version = "0.38", features = ["fs", "stdio", "termios"] }
142148
rustls = { version = "0.21", features = ["dangerous_configuration"] }
149+
rustls-pki-types = { version = "1", features = ["std"] }
143150

144151
[target.aarch64-apple-darwin.build-dependencies]
145-
hyper = { version = "0.14", features = ["full"] }
152+
hyper-582f2526e08bb6a0 = { package = "hyper", version = "0.14", features = ["full"] }
146153
mio = { version = "1", features = ["net", "os-ext"] }
147154
once_cell = { version = "1", features = ["unstable"] }
148155
rustix = { version = "0.38", features = ["fs", "stdio", "termios"] }
149156
rustls = { version = "0.21", features = ["dangerous_configuration"] }
157+
rustls-pki-types = { version = "1", features = ["std"] }
150158

151159
[target.x86_64-unknown-illumos.dependencies]
152160
bitflags-dff4ba8e3ae991db = { package = "bitflags", version = "1" }
153161
dof = { version = "0.3", default-features = false, features = ["des"] }
154-
hyper = { version = "0.14", features = ["full"] }
162+
hyper-582f2526e08bb6a0 = { package = "hyper", version = "0.14", features = ["full"] }
163+
hyper-dff4ba8e3ae991db = { package = "hyper", version = "1", features = ["full"] }
164+
hyper-util = { version = "0.1", features = ["full"] }
155165
mio = { version = "1", features = ["net", "os-ext"] }
156166
once_cell = { version = "1", features = ["unstable"] }
157167
rustix = { version = "0.38", features = ["fs", "stdio", "termios"] }
158168
rustls = { version = "0.21", features = ["dangerous_configuration"] }
169+
rustls-pki-types = { version = "1", features = ["std"] }
159170
spin = { version = "0.9", default-features = false, features = ["once", "spin_mutex"] }
160171
toml_edit = { version = "0.19", features = ["serde"] }
161172

162173
[target.x86_64-unknown-illumos.build-dependencies]
163174
dof = { version = "0.3", default-features = false, features = ["des"] }
164-
hyper = { version = "0.14", features = ["full"] }
175+
hyper-582f2526e08bb6a0 = { package = "hyper", version = "0.14", features = ["full"] }
165176
mio = { version = "1", features = ["net", "os-ext"] }
166177
once_cell = { version = "1", features = ["unstable"] }
167178
rustix = { version = "0.38", features = ["fs", "stdio", "termios"] }
168179
rustls = { version = "0.21", features = ["dangerous_configuration"] }
180+
rustls-pki-types = { version = "1", features = ["std"] }
169181
spin = { version = "0.9", default-features = false, features = ["once", "spin_mutex"] }
170182
toml_edit = { version = "0.19", features = ["serde"] }
171183

0 commit comments

Comments
 (0)