Grail tree

Bernie Hackett and I released PyMongo 2.6.3 this afternoon. It fixes some bugs introduced in 2.6.0 when we added major features to PyMongo's connection pool.

The headline fix is for a semaphore leak during connection failure: The connection pool decrements a semaphore when it creates a connection, but didn't increment the semaphore if the connection failed. If a long-lived Python process connected to MongoDB over a flaky network with frequent connection timeouts, the semaphore's value would reach zero and further connection attempts would hang. I fixed it with a big try/finally block that ensures we increment the semaphore if we can't connect.

I also fixed a sheer oversight of mine: Although you can fine-tune the pool by passing the waitQueueMultiple and waitQueueTimeoutMS parameters to MongoClient, you couldn't do the same for MongoReplicaSetClient, because it ignored those parameters.

Meanwhile, Bernie tightened up our BSON parser. It now raises errors instead of crashing when parsing a wider range of bad inputs. This continues our effort over the last few releases to harden the parser against corrupt documents, bizarre Python interpreter states, out-of-memory errors, and the like.