Skip to content

Commit 4ba9c33

Browse files
authored
update to hyper v1 (#745)
1 parent 516dabe commit 4ba9c33

File tree

12 files changed

+680
-211
lines changed

12 files changed

+680
-211
lines changed

Cargo.lock

Lines changed: 652 additions & 186 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ clap = "4.2"
106106
const_format = "0.2"
107107
crossbeam-channel = "0.5"
108108
ctrlc = "3.2"
109-
dropshot = { git = "https://github.com/oxidecomputer/dropshot", branch = "main" }
109+
dropshot = "0.12.0"
110110
erased-serde = "0.4"
111111
errno = "0.2.8"
112112
escargot = "0.5.8"
@@ -116,8 +116,8 @@ futures = "0.3"
116116
futures-util = "0.3.21"
117117
flate2 = "1.0.28"
118118
hex = "0.4.3"
119-
http = "0.2.9"
120-
hyper = "0.14"
119+
http = "1.1.0"
120+
hyper = "1.0"
121121
indicatif = "0.17.3"
122122
inventory = "0.3.0"
123123
kstat-rs = "0.2.4"
@@ -130,10 +130,10 @@ owo-colors = "4"
130130
pin-project-lite = "0.2.13"
131131
proc-macro2 = "1.0"
132132
proc-macro-error = "1"
133-
progenitor = { git = "https://github.com/oxidecomputer/progenitor", branch = "main" }
133+
progenitor = "0.8.0"
134134
quote = "1.0"
135135
rand = "0.8"
136-
reqwest = { version = "0.11.18", default-features = false }
136+
reqwest = { version = "0.12.0", default-features = false }
137137
ring = "0.17"
138138
ron = "0.8"
139139
schemars = "0.8.10"

bin/mock-server/src/lib/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,15 +397,15 @@ mod serial {
397397
use std::sync::atomic::{AtomicBool, Ordering};
398398
use std::sync::Arc;
399399

400+
use dropshot::WebsocketConnectionRaw;
400401
use futures::StreamExt;
401-
use hyper::upgrade::Upgraded;
402402
use tokio::sync::{mpsc, Notify};
403403
use tokio_tungstenite::tungstenite::protocol::{
404404
frame::coding::CloseCode, CloseFrame,
405405
};
406406
use tokio_tungstenite::WebSocketStream;
407407

408-
type WsConn = WebSocketStream<Upgraded>;
408+
type WsConn = WebSocketStream<WebsocketConnectionRaw>;
409409

410410
const DEFAULT_MAX_LEN: usize = 1024;
411411

bin/propolis-server/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ crucible-client-types.workspace = true
3030
dropshot = { workspace = true, features = ["usdt-probes"] }
3131
erased-serde.workspace = true
3232
futures.workspace = true
33-
http.workspace = true
3433
hyper.workspace = true
3534
internal-dns.workspace = true
3635
kstat-rs.workspace = true

bin/propolis-server/src/lib/migrate/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub(crate) trait MigrateConn:
2626
}
2727

2828
impl MigrateConn for tokio_tungstenite::MaybeTlsStream<tokio::net::TcpStream> {}
29-
impl MigrateConn for hyper::upgrade::Upgraded {}
29+
impl MigrateConn for dropshot::WebsocketConnectionRaw {}
3030

3131
#[derive(Copy, Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
3232
pub enum MigrateRole {

bin/propolis-server/src/lib/serial/mod.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use crate::serial::history_buffer::{HistoryBuffer, SerialHistoryOffset};
1717
use futures::future::Fuse;
1818
use futures::stream::SplitSink;
1919
use futures::{FutureExt, SinkExt, StreamExt};
20-
use hyper::upgrade::Upgraded;
2120
use propolis::chardev::{pollers, Sink, Source};
2221
use propolis_api_types::InstanceSerialConsoleControlMessage;
2322
use slog::{info, warn, Logger};
@@ -78,11 +77,14 @@ pub struct SerialTask {
7877
/// clients of a migration
7978
pub control_ch: mpsc::Sender<SerialTaskControlMessage>,
8079
/// Channel used to send new client connections to the streaming task
81-
pub websocks_ch: mpsc::Sender<WebSocketStream<Upgraded>>,
80+
pub websocks_ch:
81+
mpsc::Sender<WebSocketStream<dropshot::WebsocketConnectionRaw>>,
8282
}
8383

8484
pub async fn instance_serial_task<Device: Sink + Source>(
85-
mut websocks_recv: mpsc::Receiver<WebSocketStream<Upgraded>>,
85+
mut websocks_recv: mpsc::Receiver<
86+
WebSocketStream<dropshot::WebsocketConnectionRaw>,
87+
>,
8688
mut control_recv: mpsc::Receiver<SerialTaskControlMessage>,
8789
serial: Arc<Serial<Device>>,
8890
log: Logger,
@@ -94,11 +96,13 @@ pub async fn instance_serial_task<Device: Sink + Source>(
9496

9597
let mut ws_sinks: HashMap<
9698
usize,
97-
SplitSink<WebSocketStream<Upgraded>, Message>,
99+
SplitSink<WebSocketStream<dropshot::WebsocketConnectionRaw>, Message>,
98100
> = HashMap::new();
99101
let mut ws_streams: HashMap<
100102
usize,
101-
futures::stream::SplitStream<WebSocketStream<Upgraded>>,
103+
futures::stream::SplitStream<
104+
WebSocketStream<dropshot::WebsocketConnectionRaw>,
105+
>,
102106
> = HashMap::new();
103107

104108
let (send_ch, mut recv_ch) = mpsc::channel(4);

bin/propolis-server/src/lib/server.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ async fn instance_ensure_common(
272272
| VmError::AlreadyInitialized
273273
| VmError::RundownInProgress => HttpError::for_client_error(
274274
Some(api::ErrorCode::AlreadyInitialized.to_string()),
275-
http::StatusCode::CONFLICT,
275+
hyper::StatusCode::CONFLICT,
276276
"instance already initialized".to_string(),
277277
),
278278
VmError::InitializationFailed(e) => HttpError::for_internal_error(
@@ -409,7 +409,7 @@ async fn instance_state_monitor(
409409
state_watcher.changed().await.map_err(|_| {
410410
HttpError::for_client_error(
411411
Some(api::ErrorCode::NoInstance.to_string()),
412-
http::status::StatusCode::GONE,
412+
hyper::StatusCode::GONE,
413413
format!(
414414
"No instance present; will never reach generation {}",
415415
gen
@@ -439,7 +439,7 @@ async fn instance_state_put(
439439
}
440440
VmError::ForbiddenStateChange(reason) => HttpError::for_status(
441441
Some(format!("instance state change not allowed: {}", reason)),
442-
http::status::StatusCode::FORBIDDEN,
442+
hyper::StatusCode::FORBIDDEN,
443443
),
444444
_ => HttpError::for_internal_error(format!(
445445
"unexpected error from VM controller: {e}"
@@ -693,7 +693,7 @@ async fn instance_issue_crucible_vcr_request(
693693
.map_err(|e| match e {
694694
VmError::ForbiddenStateChange(reason) => HttpError::for_status(
695695
Some(format!("instance state change not allowed: {}", reason)),
696-
http::status::StatusCode::FORBIDDEN,
696+
hyper::StatusCode::FORBIDDEN,
697697
),
698698
_ => HttpError::for_internal_error(format!(
699699
"unexpected error from VM controller: {e}"
@@ -749,7 +749,7 @@ pub fn api() -> ApiDescription<Arc<DropshotEndpointContext>> {
749749
fn not_created_error() -> HttpError {
750750
HttpError::for_client_error(
751751
Some(api::ErrorCode::NoInstance.to_string()),
752-
http::StatusCode::FAILED_DEPENDENCY,
752+
hyper::StatusCode::FAILED_DEPENDENCY,
753753
"Server not initialized (no instance)".to_string(),
754754
)
755755
}

bin/propolis-server/src/lib/vm/request_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ impl Drop for ExternalRequestQueue {
433433
"VM destroyed before request could be handled"
434434
.to_string(),
435435
),
436-
http::StatusCode::GONE,
436+
hyper::StatusCode::GONE,
437437
)));
438438
}
439439

phd-tests/framework/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ fatfs.workspace = true
2020
futures.workspace = true
2121
flate2.workspace = true
2222
hex.workspace = true
23-
http.workspace = true
2423
libc.workspace = true
2524
newtype_derive.workspace = true
2625
propolis-client.workspace = true

phd-tests/framework/src/test_vm/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ async fn try_ensure_vm_destroyed(client: &Client) {
10491049
// nothing else that *can* be done, but the error is unusual and should
10501050
// be logged.
10511051
match error.status() {
1052-
Some(http::status::StatusCode::FAILED_DEPENDENCY) => {}
1052+
Some(reqwest::StatusCode::FAILED_DEPENDENCY) => {}
10531053
_ => {
10541054
error!(
10551055
%error,

0 commit comments

Comments
 (0)