UWFlow / rmc

Flow is a website that lets you plan courses with friends.
https://uwflow.com
MIT License
233 stars 73 forks source link

Mongodb sometimes takes longer to start and crashes Flask on Linux #81

Open jswu opened 10 years ago

jswu commented 10 years ago

Sometimes when mongod is run for the first time with our config, it takes a while to start, and Flask crashes when make local is run.

We can monitor a mongo log file to ensure it starts properly, or perhaps just "warm up" mongo after a fresh installation.

This only seems to affect Linux and not Mac.

More details in discussions of #64

michaelmior commented 10 years ago

Why not just wait for a successful connection for the socket in the script before trying to start services which depend on it? For example, checking the exit status of the following should do the trick:

echo "~." | telnet -r localhost 27017 > /dev/null

This can be done in a loop with a bit of a sleep and an eventual timeout in case something takes too long.

jswu commented 10 years ago

I don't have a machine to test this on right now, but that sounds reasonable. Feel free to implement it :) On Apr 29, 2014 12:00 AM, "Michael Mior" notifications@github.com wrote:

Why not just wait for a successful connection for the socket in the script before trying to start services which depend on it? For example, checking the exit status of the following should do the trick:

echo "~." | telnet -r localhost 27017 > /dev/null

This can be done in a loop with a bit of a sleep and an eventual timeout in case something takes too long.

— Reply to this email directly or view it on GitHubhttps://github.com/UWFlow/rmc/issues/81#issuecomment-41639768 .