Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Docker should be only started after taupage-init is done #476

Open
aermakov-zalando opened this issue Nov 30, 2017 · 5 comments
Open

Docker should be only started after taupage-init is done #476

aermakov-zalando opened this issue Nov 30, 2017 · 5 comments

Comments

@aermakov-zalando
Copy link
Contributor

If the instance is rebooted because of AWS instance autorecovery, the application will start before the disks are mounted (fsck takes time, and the image is already cached), which will obviously fail. This should be fixed by making the application only start after all (or at least important for the application) init scripts are done. See also #441.

@a1exsh
Copy link
Contributor

a1exsh commented Nov 30, 2017

Not sure why you see relation with #441?

@aermakov-zalando
Copy link
Contributor Author

Because we should also not start the application if the init tasks fail.

@a1exsh
Copy link
Contributor

a1exsh commented Nov 30, 2017

Yes, but in this case init didn't fail, it was just done in the incorrect order. And I think if taupage-init fails a step, it doesn't go to the next one?

@aermakov-zalando
Copy link
Contributor Author

The bug report has led me to believe that it'll just proceed to the next script. However you're right, it'll just abort and not do anything, and the issue with container starting isn't related to taupage-init.

@a1exsh
Copy link
Contributor

a1exsh commented Nov 30, 2017

The root cause here is that there 2 sets of init scripts in taupage: the ones shipped in the system packages that live in /etc/init.d, with all the dependencies to define proper startup order in place, and another set of custom script in /opt/taupage/init.d.

This issue is exactly the case when normal operation of a system init script (for docker) depends on running a custom init script from taupage (10-prepare-disks.py). But the order is the opposite of what it should be: docker server starts before disks are mounted. In normal startup scenarios it's not a problem, because docker starts w/o any pre-existing containers, and the container is created later, after disks are mounted. In case of autorecovery (or reboot of instance) you can have this race condition: if docker starts the pre-existing container before the disks are mounted, the application can fail.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants