docker icon indicating copy to clipboard operation
docker copied to clipboard

Tarantool that was ran in the docker swarm is not accessible for 30 seconds

Open entei-11 opened this issue 5 years ago • 1 comments

I faced an issue that I can't access Tarantool for 30 seconds after I start Tarantool in the docker swarm. After several tests I found out that a forwarded port for the stack is not exposed until the tarantool docker container becomes in the "healthy" state. Also, I found out that transition from the "starting" state to "healthy" takes exactly 30 seconds that I have to wait.

A tarantool docker container that I start directly by using run-command exposes the forwarded port immediately after it runs into the "starting" state. So, I believe that the issue is caused by combination of the long tansition from "starting" to "healthy" states and some specific behaviour of the docker container hosted by the docker swarm.

I wrote scripts to reproduce the issue.

Use run-docker-only.sh to start a tarantool container by docker run. You can see that for 30 seconds it stays in the "starting" state and then goes to the "healthy" state. And all that time you can connect to the tarantool from the outside.

bash run-docker-only.sh

Use run-docker-stack.sh to start a tarantool container into the swarm by docker stack deploy. Here you can see the same state transition that lasts 30 seconds. But the tarantool becomes available from the outside just after the tarantool becomes healthy.

bash run-docker-only.sh

You can find demo in the attached zip tarantool_run_test_30secs.zip or in this repo tarantool-run-30secs-demo

entei-11 avatar Nov 24 '19 17:11 entei-11

Maybe related to https://github.com/tarantool/tarantool/issues/4592

Totktonada avatar Dec 19 '19 11:12 Totktonada