Skip to content
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

[0.4.x] Disable auto-release buffers option forces to read content #474

Closed
Crystark opened this issue Feb 8, 2016 · 2 comments
Closed
Labels
Milestone

Comments

@Crystark
Copy link

Crystark commented Feb 8, 2016

Hi,

Here's a use case: When I add the disableAutoReleaseBuffers option to my server and i entrer a case where i don't consume the incoming content (e.g. 404 NOT FOUND) then the ByteBuf isn't released and thus creates a leak.

I would think that .ignoreContent would do the work but it seems it doesn't: you have to read the incoming ByteBuf and release it manually. This can be somewhat problematic cause using that option, rather than doing a retain where you want to use the ByteBuf, you need to do a release everywhere you do not want to use it.

And here's a couple questions while i'm at it:

  • Does ignoreContent have to be called every time you do not use it ?
  • Does the observable you return in the RequestHandler have to return an Observable issued by one of the response methods or would any observable do (even Observable.empty) ?

Thanks

@NiteshKant NiteshKant added the bug label Feb 18, 2016
@NiteshKant
Copy link
Member

@Crystark Apologies for the delayed response. This sounds like a bug. One should not be forced to call .ignoreContent(). In absence of a subscriber, the buffer must be released with disableAutoReleaseBuffers.

RequestHadler can return any Observable instance.

@NiteshKant NiteshKant added this to the 0.4.16 milestone Feb 19, 2016
NiteshKant added a commit to NiteshKant/RxNetty that referenced this issue Apr 21, 2016
…not subscribed)

When auto-release it turned off and the HTTP content is not subscribed, the buffers which are disposed from `UnicastContentSubject` are not released (which otherwise would have been released by the subscriber).

This change properly release the disposed buffers when auto-release is turned off.
NiteshKant added a commit that referenced this issue Apr 22, 2016
…ribed) (#497)

When auto-release it turned off and the HTTP content is not subscribed, the buffers which are disposed from `UnicastContentSubject` are not released (which otherwise would have been released by the subscriber).

This change properly release the disposed buffers when auto-release is turned off.
@NiteshKant
Copy link
Member

Fixed via #497

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants