Skip to content

Commit 3f6c926

Browse files
committed
Review feedback
- Add more error variants, to better maintain context and the actual error chains. - Remove zone-specific commmands - Remove hand-rolled `PartialOrd` implementation for simplicity, but add comment about the variant order being load-bearing. - Add the handle for the cleanup task to the `ZoneBundler`, and abort it on drop.
1 parent a70596c commit 3f6c926

File tree

3 files changed

+228
-171
lines changed

3 files changed

+228
-171
lines changed

sled-agent/src/instance.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ use std::sync::Arc;
4848
use tokio::task::JoinHandle;
4949
use uuid::Uuid;
5050

51-
//use propolis_client::generated::DiskRequest;
52-
5351
#[derive(thiserror::Error, Debug)]
5452
pub enum Error {
5553
#[error("Failed to wait for service: {0}")]
@@ -558,7 +556,6 @@ impl InstanceInner {
558556
.create(
559557
&running_state.running_zone,
560558
ZoneBundleCause::TerminatedInstance,
561-
vec![],
562559
)
563560
.await
564561
{
@@ -683,11 +680,7 @@ impl Instance {
683680
} => {
684681
inner
685682
.zone_bundler
686-
.create(
687-
running_zone,
688-
ZoneBundleCause::ExplicitRequest,
689-
vec![],
690-
)
683+
.create(running_zone, ZoneBundleCause::ExplicitRequest)
691684
.await
692685
}
693686
}

sled-agent/src/services.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,15 +2025,15 @@ impl ServiceManager {
20252025
return self
20262026
.inner
20272027
.zone_bundler
2028-
.create(zone, ZoneBundleCause::ExplicitRequest, vec![])
2028+
.create(zone, ZoneBundleCause::ExplicitRequest)
20292029
.await;
20302030
}
20312031
}
20322032
if let Some(zone) = self.inner.zones.lock().await.get(name) {
20332033
return self
20342034
.inner
20352035
.zone_bundler
2036-
.create(zone, ZoneBundleCause::ExplicitRequest, vec![])
2036+
.create(zone, ZoneBundleCause::ExplicitRequest)
20372037
.await;
20382038
}
20392039
Err(BundleError::NoSuchZone { name: name.to_string() })
@@ -2120,7 +2120,7 @@ impl ServiceManager {
21202120
if let Err(e) = self
21212121
.inner
21222122
.zone_bundler
2123-
.create(&zone, ZoneBundleCause::UnexpectedZone, vec![])
2123+
.create(&zone, ZoneBundleCause::UnexpectedZone)
21242124
.await
21252125
{
21262126
error!(

0 commit comments

Comments
 (0)