Open harrisonfeng opened 9 years ago
I don't get it. Under what condition may that file not exist?
https://github.com/harrisonfeng/docker-registry/blob/master/docker_registry/toolkit.py#L325
when search_backend sets to sqlalchemy, first start the container, then the container will stop automatically as that error happened. Actually, that error will happen every time. So I cannot run docker registry container at all. With my fix, I can run it happily.
Ok. The better fix here would be to use lockfile (http://pythonhosted.org/lockfile/). Would you be willing to try this? Thanks.
@dmp42 why is lockfile a better solution?
I'm not sure what @dmp42 is thinking, but as a general rule -- if you can let someone else do the tricky bits, the better. And lockfiles are notoriously tricky.
@docwhat @pires the current implementation is a parody of a proper file locking mechanism, and it fails miserably as this report demonstrates... So yeah, let's use something that does work :)
Got it, thanks ;-)
+1 if this change reduces crashes at least in the interim. Currently docker run -p 5000:5000 registry
is broken out-of-the-box (try running it several times).
+1. First quick fix the broken part (done with this PR), then in a separate PR improve locking
It will try to remove non-existing registry._setup_database.lock when search_backend setting to sqlalchemy
Signed-off-by: Harrison Feng harrison_feng@163.com