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

Response should be flushed on RequestHandler's failure #226

Closed
NiteshKant opened this issue Sep 7, 2014 · 1 comment
Closed

Response should be flushed on RequestHandler's failure #226

NiteshKant opened this issue Sep 7, 2014 · 1 comment
Assignees
Milestone

Comments

@NiteshKant
Copy link
Member

HttpConnectionHandler does not flush the response on request handling termination to optimize for gathering writes from the request handler.

This makes sense for onComplete() as for graceful completion the RequestHandler must make the decision to flush or not. However, for error, specifically for unexpected errors this default (of not flushing the response) does not make sense as the error could have happened even before the handler had chance to populate/handle the response. In a case when the request handling is done in a different thread* and failed without flushing the response, the response would not be flushed unless some other code invokes flush() on the same connection (in response to a different request).

* The reason why this works for request handling done in the server eventloop is that we do an explicit flush at the channel read complete.

@NiteshKant
Copy link
Member Author

PR #227 fixes this issue by flushing the response in case of an error from RequestHandler

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

No branches or pull requests

1 participant