Return the result immediately if we run out of memory

Authored by mollekopf on Apr 30 2020, 6:16 PM.



If we don't:

  • we was a bunch of cpu because we'll be going over the entire list of

remaining messages to see if any fit (potentially over and over)

  • we end up with out of order results (which is suppose should be

technically ok)

The only thing this change makes worse is that we potentially add
another roundtrip because we didn't include a smaller message that would
have still fit in the same batch.

Diff Detail

rS syncroton
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mollekopf requested review of this revision.Apr 30 2020, 6:16 PM
mollekopf created this revision.
This revision was not accepted when it landed; it landed in state Needs Review.May 4 2020, 11:50 AM
This revision was automatically updated to reflect the committed changes.