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

Improve Styx data plane. #451

Merged
merged 3 commits into from
Aug 8, 2019
Merged

Conversation

mikkokar
Copy link
Contributor

@mikkokar mikkokar commented Aug 7, 2019

Summary

This PR fixes three little problems that involve responses that arrive before the corresponding request is fully sent.

Fix 1:

HttpRequestOperation has two callback handlers on the same channel future that both trigger an observable error. Omitting a second onError violates Rx.Java protocol. Also it is pointless because Rx suppresses the 2nd onError event.

Impact: Confusing log messages.

Fix: collapse the two callbacks into one.

Fix 2:

"Connection: close" header was not included in some of the error responses.

Impact: The remote peer may start sending the next request on a channel that was about to be closed, resulting in a wasted request.

Fix: Add missing "Connection: close" header to the affected error responses.

Fix 3:

HttpRequestOperation.RequestBodyChunkSubscriber was setting the request body completed flag too soon. Therefore isOngoingRequest test in execute was prematurely returning false. This could allow the connection to be handed over to the next request before the previous is fully sent, resulting in Netty HTTP codec getting out-of-sync.

Impact: A failure to proxy a request to origins. Happens very rarely under heavy load. This issue may show up in load tests.

Fix: Wait until Netty has acknowledged the request EMPTY_LAST_CONTENT before setting completed flag to true.

@mikkokar mikkokar requested review from kvosper and dvlato August 7, 2019 15:46
Add channel identifier to error logs.
Wait until EMPTY_LAST_CONTENT is actually before marking request completed.
@mikkokar mikkokar merged commit beffff3 into ExpediaGroup:master Aug 8, 2019
@mikkokar mikkokar deleted the hro-logging branch August 8, 2019 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants