doctrine/mongodb — pull request #35 by jwage (2011-12-17 07:38:48+00:00)
Title: Adding experimental retry functionality.

In our application at OpenSky we're dealing with errors from mongodb connections and cursors when our replica set changes. For example when a master steps down, it may take a few seconds for a slave to be elected as primary so during that time we need to handle this and retry functions that can throw MongoConnectionException and MongoCursorException.

Sometimes randomly we've gotten the errors as well so I think we just need to handle it and retry when it happens. For example when iterating over a cursor, you may get an exception from one getNext() call but simply trying again right afterwards it will work.