-
Notifications
You must be signed in to change notification settings - Fork 896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffer leak reported in THttpClientDelegate #5481
Comments
This looks like a old version, and there's been quite a few bugfixes regarding buffer leak since 😅 Is it difficult for you to try and upgrading and seeing if the issue persists? |
I tried to upgrade armeria to version 1.27.2,but the issue persists:
|
Thanks for following up on this, I think your analysis is right 👍 We're allocating a pooled buffer for thrift requests, so we need to make sure we release it correctly (or it is a leak) by aborting the request. Line 134 in 75d5af1
Since I agree with your proposal, although I think just handling inside |
Thanks for fixing it in the next version.🤝🤝 |
Thanks! We'll handle it then 🙇 🙇 🙇 |
Motivation: We received a report where thrift was leaking pooled byte buffers. We use pooled byte buffers to create the thrift request in `THttpClientDelegate` assuming that it will be released when sent on the wire for normal cases. https://github.com/line/armeria/blob/7f302505a05d24e7704bcffc43fab6337344cb2c/thrift/thrift0.13/src/main/java/com/linecorp/armeria/internal/client/thrift/THttpClientDelegate.java#L134 However, if any requests don't have a chance to reach the wire, they will leak the byte buffer. I believe it is reasonable to assume that requests not decoded properly should be cleaned up. Hence, I propose we do an extra `req.abort` inside `handlePreDecodeException`. Modifications: - Modify `handlePreDecodeException` to accept an additional `HttpRequest` parameter - Abort the request with the exception if exists Result: - #5481 <!-- Visit this URL to learn more about how to write a pull request description: https://armeria.dev/community/developer-guide#how-to-write-pull-request-description -->
Handled by #5535 |
When the error com.linecorp.armeria.client.circuitbreaker.FailFastException occurs, occasional ByteBuf leak warnings may appear.
armeria version: 0.9.99
netty version: 4.1.94.Final
The text was updated successfully, but these errors were encountered: