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.
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
runsdfxvm 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.