OpenNMT / nmt-wizard

Launch NMT tasks on the cloud
MIT License
13 stars 15 forks source link

Infinite loop in server/worker.py #68

Open alexkillen opened 4 years ago

alexkillen commented 4 years ago

I attempted to run the following command:

cd server && python worker.py configfile.json

as specified in the README.md to start a worker, using a fresh Redis instance and a simple config file based on the ssh template. This gets stuck in an infinite loop while attempting to load a default configuration from Redis, as the retry variable is never incremented.

https://github.com/OpenNMT/nmt-wizard/blob/065792ab1fd6b58ad4fc52d91d6c61a096a33d8d/server/worker.py#L68-L77

Also, I can't tell from the documentation, but (once the above is fixed) how are you meant to start a worker if you don't already have a default configuration in the Redis database?

nguyenhn-systran commented 4 years ago

You are right: the launcher (Flask server) should be started first to save the default config in Redis.

alexkillen commented 4 years ago

Thanks for the response, that clarifies the situation. Just a reminder to add a retry += 1 into the above loop to avoid it looping infinitely.

Also updating the README.md to make it clearer that the server should be launched first would be helpful. Currently it states that:

The first component to launch is the worker that should always be running

which is what had me confused.

Thanks again.