-
Notifications
You must be signed in to change notification settings - Fork 255
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
HttpClient should cancel request write & response processing on unsubscription #21
Comments
I was under the impression that if the Observer is unsubscribed, the channel should be closed in current implementation. But it does not seem to be true. Here are the steps I observed during debugging:
So it seems that the channel still remains open. |
The unsubscribe from connectObservable does not close the connection as it just means, the subscriber does not want to get any new connections. The connection close is explicit, which does not seem to be happening currently in HttpClient. HttpClient should call close on the connection when the request processing is completed. |
…tpClient.submit()
Now RxClient does cancel all pending writes on unsubscribe (or connection close) but it does not explicitly close a pooled connection if the response is not yet over. |
This was fixed as part of #208 in release 0.3.15 |
Currently HttpClient cancels the connection subscription when the caller of HttpClient.submit() unsubscribe. This in turn closes the connection.
The relevant code is here:
https://github.com/Netflix/RxNetty/blob/master/src/main/java/io/reactivex/netty/protocol/http/HttpClientImpl.java#L71
Ideally, it should do the following:
In the above statements, close the connection in presence of connection pooling (#20) would signify connection returning to pool. In such a case, the connection should be in a sane state to re-use i.e. no read/write should be pending.
The text was updated successfully, but these errors were encountered: