-
Notifications
You must be signed in to change notification settings - Fork 254
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
HTTP Redirect fails when there is a connection pool #129
Comments
The issue here was that as part of sending (onNext()) the first response (redirect response), we were submitting the redirect request. If the connection is reused (for connection pool), it resets the content subject (reacting to ConnectionReuseEvent) in ClientRequestResponseConverter. The ClientRequestResponseConverter was referring to the "current content subject" while invoking an onComplete(), which is invoked when the content on the first response is over. Now, in the above situation, since the content subject is changed between processing headers and processing content (in the same method), the onComplete() is called on the content subject of the second response and not the first as it is expected. The fix is two folds: 1) Move the redirect call in RedirectOperator to onComplete()/onError() of the first observer. 2) In ClientRequestResponseConverter use the subject that was present when the channelRead() was received and do not refer to the instance level state of the subject. From the perspective of this bug, 1) is sufficient but 2) is the correct way of handling the shared state.
The issue here was that as part of sending (onNext()) the first response (redirect response), we were submitting the redirect request. The fix is two folds:
From the perspective of this bug, 1) is sufficient but 2) is the correct way of handling the shared state. |
The following test, which is slightly modified from the existing one in HttpClientTest, fails:
The test fails with the following stack trace, which means there is no invocation of the onNext() to the blocking observable.
The text was updated successfully, but these errors were encountered: