A connection to a mongos with the "exhaust" flag set is ignored, and mongos returns a regular cursor instead.
The connection deadlocks after the first batch if the driver iterates over the cursor: mongos is waiting for a getMore operation, while the driver is waiting for an OP_REPLY.
Remove the exhaust flag from queries through mongos.
MongoDB 2.6 production releases up to 2.6.3 are affected by this issue.
The fix is included in the 2.6.4 production release.
Disallow exhaust query option through mongos.
Mongos doesn't implement exhaust cursors. If a client creates a cursor by sending OP_QUERY to mongos with the "exhaust" flag set, mongos ignores it and returns a regular cursor. When the driver iterates the cursor, it deadlocks after the first batch: mongos is waiting for a getMore, and the driver is waiting for an OP_REPLY.
Those official drivers that implement exhaust cursors are written to prevent this case. But it'd be even better if mongos checked the exhaust flag and failed immediately. (Until such time as mongos implements exhaust cursors.)
- is related to
SERVER-15318 copydb should not use exhaust flag when used against mongos
- related to
SERVER-2627 Mongos should support QueryOption_Exhaust