Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example doesn't work. mongotor.database.Database.connect() blocks python #32

Open
robert-zaremba opened this issue Jan 15, 2013 · 2 comments

Comments

@robert-zaremba
Copy link

The example from homepage http://marcelnicolay.github.com/mongotor/ doesn't works.
The full application based on this example is presented on: https://gist.github.com/4540679.

I'm describing the issue based on 69d91a9 revision.

The problem is in mongotor/database.py:65 (line) - in the function Database.init.
In this function it construct Node to wrap mongodb connection.
The connections are started in database.py:65 - which in the end calls connect on each node. The connect method gets callback which sets Database._initialized value.
But the callback is called at the end of node.connect method which is asynchronous - in the middle of this method is an asynchronous call to database.

So callback will be called in the next event loop flow. But this will not come since Database.connect fires the while loop which block the entire IOLoop (throught self._initialized field) - mongotor/database.py:65

If you want we can work on this together. Just type me some message.

@robert-zaremba
Copy link
Author

this is also the reason of issue #17

@tahajahangir
Copy link
Contributor

Problem is fixed in version 1.0.0.

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

No branches or pull requests

2 participants