marcelnicolay / mongotor

An asynchronous driver and toolkit for accessing MongoDB in Tornado
Other
57 stars 16 forks source link

Don't call `_config_nodes` when another `_config_nodes` is in progress #37

Closed tahajahangir closed 10 years ago

tahajahangir commented 11 years ago

If we call get_node twice before starting IOLoop, _config_nodes will be called twice, and therefore subsequent _config_nodes will be called twice every 30-seconds.

This pull request, also three trivial fix commits.

marcelnicolay commented 11 years ago

Hi, thanks for your time fixing this problem.

I tried to run the tests in your branch but they didn't pass. Could you fix the problems? I use the make tests command.

tahajahangir commented 10 years ago

I rebased and modified this pull requests and it now depends on pull #43 (travis build)

I modified one test, and now, all tests are passing Build Status

There is an incorrect behavior in mongotor: creating (and connecting to) a new Connection is synchronous. Because of this, when sending message to an unavailable node (with send_message) the function raises an exception synchronously. The old test relies on this synchronous behavior. I modified it to use stop/wait functions to wait for asynchronous operation.

I (probably) will try to switch to async connects in another pull request.