inspirehep / inspire-docker

Dockerfiles for inspirehep/inspire-next application
GNU General Public License v2.0
4 stars 13 forks source link

python_base: don't fail to start on chown error #49

Closed david-caro closed 7 years ago

david-caro commented 7 years ago

The containers got in a race condition sometimes where the chown tried to change the ownership of the '.pyc' files while they were removed by another container, failing to run the docker_entrypoint script and failing to start the container. Now it will ignore such errors and just continue running (if there were serious issues, it will fail to run the tests).

Fixes https://github.com/inspirehep/inspire-next/issues/2385

Signed-off-by: David Caro david@dcaro.es

david-caro commented 7 years ago

I'm running locally to make sure it fixes the issue, but so far it ran >10 times without failing because of this.

kaplun commented 7 years ago

What is || :? Additionally this ignores errors in general. Hopefully it doesn't mask other errors? Otherwise LGTM!

david-caro commented 7 years ago

What is || :? Additionally this ignores errors in general. Hopefully it doesn't mask other errors?

In bash (and any shell) the : is a command that just does not do anything, similar to true, so something || : means run something, and if it fails (||) run :, so the return code of the statement line is always 0.

That will ignore all the errors of the commands followed by || :, that in this case we don't really want to handle specially, as if it fails, it will fail later anyhow (there's no way that if something bad happens, it will generate a false positive).