poorbarcode opened a new pull request, #24423: URL: https://github.com/apache/pulsar/pull/24423
### Motivation Thanks @mattisonchao for sharing the issue context and the code for reproducing the issue. - There is a write buffer that Netty provided is `outboundBuffer = io.netty.channel.ChannelOutboundBuffer`, it is used to cache data that should be written out, and batch flush to benefit performance. - When `ChannelOutboundBuffer` caches too much data, it will mark `channel` as `unwritable`, but it continuously caches the data, if the user continuously calls `channel.write`, eventually it leads to an OOM - You can reproduce the issue with the new test  ### Modifications - Add a broker param: `connectionMaxPendingWriteBytes`, pause handling requests when `ChannelOutboundBuffer`'s pending write bytes length is larger than the threshold. Resume when the channel is `writable` again. ### Documentation <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> ### Matching PR in forked repository PR in forked repository: x -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
