Each query operation with a YIELD_AUTO yield policy incurs a time-based yield after every 10ms of active operation. However, the "start time" for the 10ms calculation is incorrectly considered to be before the last yield started, as opposed to after the last yield finished. This can lead to a scenario where a query will repeatedly yield after only one unit of work has completed, if the query needs to wait in line more than 10ms for a writer to yield the lock.
This is a regression introduced in 3.1.7 by
SERVER-19374 (affects development versions 3.1.7 through 3.2.0-rc2 only).
Reproduce with the following script, and confirming the "numYields" value displayed in the diagnostic log. The query is expected to yield 2 times, but it instead yields 8 times.