Docker stop -t 300 storagenode

Very early on in the Alpha I would always use

sudo docker stop -t 300 storagenode

It would time the stop and then end the process after that period. However in the current version 1.3.3 when I run the command the node stops after a few seconds and is no longer timed to that 300 seconds.

Has there been major improvement in StorJ and the stop command to stop the node more quickly than previously?

Hello Sasha,

Docker stop option --time , -t sets timeout in seconds to wait for application to stop gracefully before killing container.
Seems like during Alpha your storagenode container was forcefully killed each time you stopped it.

Best regards,
Yaroslav

thats interesting…
i only started a couple of months ago, so from my view it always exited nearly immediately in a few sec or a bit slower if i been doing stupid stuff to my system or docker…

i exited a few times without the -t 300 command until i read in the docker documentation that it was for a “graceful shutdown” does that mean that without the -t it isn’t a graceful shutdown and should that be avoided… or am i just wasting my time writing -t 30 every time… yes i use 30 because it closes in a couple of sec everytime… :smiley:

There have been quite a few updates to fix lots of things around this. One of the major ones is an update that got rid of endlessly hanging open connections. Other efficiency updates would also have an impact on this.

It always tries to shut down gracefully, but docker is impatient by default and doesn’t wait more than 10s before it forces it killed. That’s usually enough, but not always, especially on slower or overloaded systems. But these days it’s always a few seconds at most on my machine as well. Regardless, since it could cause corruption if it gets forcibly killed, I always use the -t 300 parameter.

3 Likes

Early on my nodes would take many seconds but they did a good job and it now never takes more than a few. I often forget to use -t300 but no problems so far because it only takes a few seconds. But you never know, especially if the node is busy with some stuff. So better to use it, just in case. Don’t want to risk some corrupted DB.

1 Like

It is now in the command to launch the docker
docker run -d --restart unless-stopped --stop-timeout 300 \ etc
you do not need to stop -t 300

2 Likes

Except that most nodes have been set up prior to that being added to the docs and definitely still need to use it.

the run command is getting… substantial… updated mine…

yeah i didnt see that change either…