Revisit back pressure implementation (dotnet/corefx#35711)
- Today when using a PipeReader from a Pipe, when the pause threshold is hit and the reader does not consume enough data to unblock the writer (enough to reduce the resume threshold) an exception is thrown. This exception is extremely hard to understand and work around since it's based on a limit set by the owner of the Pipe. It leads to people setting an extremely big limit (bigger than the biggest message) or disabling the limit completely.
- The changes the back pressure mechanic to be based on examined instead of consumed. This pauses the writer if the pause threshold is hit, but lets the reader continue to buffer until a logical payload is reached (whatever matters to the protocol).
- This breaks software that relied on these limits to enforce a maximum buffer size and those pieces of code need to now handle their own maximum buffer size.
Commit migrated from https://github.com/dotnet/corefx/commit/
ce278ee840561e90b2c6bb9daaee5ff4b9cce293