stacks-network / stacks-blockchain-docker

Stacks-blockchain with API using docker compose
GNU General Public License v3.0
27 stars 37 forks source link

restart action odd behavior #76

Closed criadoperez closed 1 year ago

criadoperez commented 2 years ago

If you are running the script with a any flag (lets use proxy flag an an example) and restart the service with:

./manage.sh -n testnet -a restart -f proxy everything is restarted as expected.

If you however, restart with: ./manage.sh -n testnet -a restart the proxy container is stopped and never activated again as you can see here:

$> ./manage.sh -n testnet -a restart 
Stopping stacks-blockchain 
    Timeout is set for 1200 seconds 
[+] Running 1/1
 ⠿ Container stacks-blockchain  Stopped                                                                         1.5s
Stopping stacks-blockchain-api 
[+] Running 1/1
 ⠿ Container stacks-blockchain-api  Stopped                                                                     0.3s
Stopping postgres 
[+] Running 1/1
 ⠿ Container postgres  Stopped                                                                                  0.2s
Stopping nginx    
[+] Running 1/1
 ⠿ Container nginx  Stopped                                                                                     0.2s
Stopping all services for stacks-blockchain 
Stopping all services 
[+] Running 5/5
 ⠿ Container nginx                  Removed                                                                     0.1s
 ⠿ Container stacks-blockchain      Removed                                                                     0.0s
 ⠿ Container stacks-blockchain-api  Removed                                                                     1.9s
 ⠿ Container postgres               Removed                                                                     0.1s
 ⠿ Network stacks                   Removed                                                                     0.1s
[ Success ]      Brought down testnet
Starting all services for stacks-blockchain 
[+] Running 4/4
 ⠿ Network stacks                   Created                                                                     0.1s
 ⠿ Container postgres               Started                                                                     0.8s
 ⠿ Container stacks-blockchain-api  Started                                                                     1.0s
 ⠿ Container stacks-blockchain      Started                                                                     1.6s
[ Success ]      Brought up testnet
    Follow logs: ./manage.sh -n testnet -a logs

Is this behavior expected? I would expect a restart to leave everything as it was. That means re-starting every container it stops.

Similar problem occurs if you are NOT running the proxy service but restart it with the proxyflag. It starts a process that wasn't running in the first place.

I would propose the following behavior instead: ./manage.sh -n testnet -a restart doesn't accept any flags and restarts all running services.

The same way the ./manage.sh -n testnet -a pull and ./manage.sh -n testnet -a down, they pull or stop all running services.

Also, if all services are down, the current behavior is that it starts them. This is less of an issue, but I would consider instead a message explaining that all services are down and you can start them with another command.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 1 year ago

This issue has been automatically closed. Please reopen if needed.