Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

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

Open
jswu opened this issue Feb 27, 2014 · 2 comments
Open

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

jswu opened this issue Feb 27, 2014 · 2 comments

Comments

@jswu
Copy link
Member

jswu commented Feb 27, 2014

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

@divad12 divad12 added the bug label Feb 27, 2014
JGulbronson added a commit to JGulbronson/rmc that referenced this issue Mar 28, 2014
mduan pushed a commit that referenced this issue Apr 12, 2014
@michaelmior
Copy link
Contributor

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
Copy link
Member Author

jswu commented Apr 29, 2014

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//issues/81#issuecomment-41639768
.

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

No branches or pull requests

4 participants