basho/riak_kv — pull request #529 by beerriot (2013-04-09 15:23:47+00:00)
Title: Count async MR results against the sink buffer size cap

While chasing another issue, I found that MR results delivered to an FSM sink via `gen_fsm:send_event/2` are not counted against the buffer size limit. This method is used to deliver 10 results before `gen_fsm:sync_send_event/3` is used once. Since only the results sent synchronously were counted against the buffer size limit, the limit actually imposed was effectively 10 times higher than expected.

The first commit in this PR modifies the eunit test to demonstrate the issue. The second commit fixes the problem.