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

[sled-agent] Update propolis dependency, to use simpler paths #950

Merged
merged 3 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Cargo.lock

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

6 changes: 4 additions & 2 deletions package-manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,7 @@ zone = true
[external_package.propolis-server.source]
type = "prebuilt"
repo = "propolis"
commit = "e984409a425df97338efa2c53ba3e40c73668638"
sha256 = "206ef42e90d157e3314f4745ddb4422b3c93a16881749824037853e6f39f3762"
commit = "abd372deb0a7dfa33f138f7741c5107184fa7088"
# The SHA256 digest is automatically posted to:
# https://buildomat.eng.oxide.computer/public/file/oxidecomputer/propolis/image/<commit>/propolis-server.sha256.txt
sha256 = "80eb60d7c1eb15d261baeb3a4e9179beff491b5cc20bfb172960e78c5d331b94"
2 changes: 1 addition & 1 deletion sled-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ omicron-common = { path = "../common" }
p256 = "0.9.0"
percent-encoding = "2.1.0"
progenitor = { git = "https://github.com/oxidecomputer/progenitor" }
propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "3a4fd8fa54ce8e1117bfa259bea39bca87f8ea14" }
propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "abd372deb0a7dfa33f138f7741c5107184fa7088" }
rand = { version = "0.8.5", features = ["getrandom"] }
reqwest = { version = "0.11.8", default-features = false, features = ["rustls-tls", "stream"] }
schemars = { version = "0.8", features = [ "chrono", "uuid" ] }
Expand Down
21 changes: 9 additions & 12 deletions sled-agent/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ async fn wait_for_http_server(
backoff::retry_notify(
backoff::internal_service_policy(),
|| async {
// This request is nonsensical - we don't expect an instance to be
// using the nil UUID - but getting a response that isn't a
// connection-based error informs us the HTTP server is alive.
match client.instance_get(Uuid::nil()).await {
// This request is nonsensical - we don't expect an instance to
// exist - but getting a response that isn't a connection-based
// error informs us the HTTP server is alive.
match client.instance_get().await {
Ok(_) => return Ok(()),
Err(value) => {
if let propolis_client::Error::Status(_) = &value {
// This means the propolis server responded to our garbage
// This means the propolis server responded to our
// request, instead of a connection error.
return Ok(());
}
Expand Down Expand Up @@ -254,7 +254,7 @@ impl InstanceInner {
.as_ref()
.expect("Propolis client should be initialized before usage")
.client
.instance_state_put(*self.id(), request)
.instance_state_put(request)
.await?;
Ok(())
}
Expand Down Expand Up @@ -590,19 +590,16 @@ impl Instance {
//
// They aren't modified after being initialized, so it's fine to grab
// a copy.
let (instance_id, client) = {
let client = {
let inner = self.inner.lock().await;
let id = *inner.id();
let client = inner.running_state.as_ref().unwrap().client.clone();
(id, client)
inner.running_state.as_ref().unwrap().client.clone()
};

let mut gen = 0;
loop {
// State monitoring always returns the most recent state/gen pair
// known to Propolis.
let response =
client.instance_state_monitor(instance_id, gen).await?;
let response = client.instance_state_monitor(gen).await?;
let reaction =
self.inner.lock().await.observe_state(response.state).await?;

Expand Down