dfinity / snsdemo

Developer focused SNS deployment demo
15 stars 6 forks source link

Refuse to create a snapshot if a replica is running. #362

Closed dskloetd closed 4 months ago

dskloetd commented 4 months ago

Motivation

When creating a snapshot, if any replicas are already running, they are killed. This can be confusing or unintended.

But especially if it's a previously installed snapshot, that snapshot can be corrupted before it's stopped. For example, when bin/dfx-snapshot-stock-make runs dfxvm default "$(jq -r .dfx dfx.json)" this may change the dfx version with which the currently active snapshot will be run next time, leading to corruption.

Changes

Refuse to start the snapshot creation process if a replica is running.

Tested

Ran bin/dfx-snapshot-stock-make while also creating another snapshot.