Skip to content

Commit

Permalink
make comment more constructive
Browse files Browse the repository at this point in the history
  • Loading branch information
gjcolombo committed Apr 13, 2023
1 parent 2067fc1 commit 7e4c45b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nexus/src/app/sagas/instance_create.rs
Expand Up @@ -1335,7 +1335,10 @@ async fn sic_instance_ensure_registered(
//
// TODO-correctness: This is dangerous if this step is replayed, since
// a user can discover this instance and ask to start it in between
// attempts to run this step.
// attempts to run this step. One way to fix this is to avoid refetching
// the previous runtime state each time this step is taken, such that
// once this update is applied once, subsequent attempts to apply it
// will have an already-used generation number.
let runtime_state = db::model::InstanceRuntimeState {
state: db::model::InstanceState::new(InstanceState::Stopped),
// Must update the generation, or the database query will fail.
Expand Down

0 comments on commit 7e4c45b

Please sign in to comment.