Skip to content

Commit

Permalink
wip: actually check for failed state before telling sled-agent we fai…
Browse files Browse the repository at this point in the history
…led it.
  • Loading branch information
lif committed Feb 2, 2024
1 parent ac2e7a0 commit b59dace
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions nexus/src/app/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1084,14 +1084,25 @@ impl super::Nexus {
.await?;
if !inst_updated && !vmm_updated {
// the generation number bumped up by the timeout task.
// TODO check actual state value (need more specificity than these two bools?)
let state = self
.db_datastore
.instance_fetch_with_vmm(opctx, &authz_instance)
.await?;
Ok(HandleInstancePutResultResult::TimedOut {
generation: *state.instance().runtime().gen,
})
match state.instance().runtime().nexus_state.0 {
InstanceState::Failed => {
let generation = *state.instance().runtime().gen;
warn!(
self.log,
"Informing sled-agent of timed-out instance";
"instance_id" => %instance_id,
"generation" => %generation
);
Ok(HandleInstancePutResultResult::TimedOut {
generation,
})
}
_ => Ok(HandleInstancePutResultResult::Ok),
}
} else {
Ok(HandleInstancePutResultResult::Ok)
}
Expand Down

0 comments on commit b59dace

Please sign in to comment.