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

Header "connection: close" disconnects the client before Response Stream is started #2276

Open
dkalinowski opened this issue Mar 10, 2025 · 0 comments

Comments

@dkalinowski
Copy link

dkalinowski commented Mar 10, 2025

Describe the bug

In our project we use Drogon for HTTP response streaming.
However, when client includes connection header that is not keep-alive, response stream is immediaitely closed.

Source code:

if (!respImplPtr->ifCloseConnection())
{
asyncStreamCallback(
std::make_unique<ResponseStream>(conn->sendAsyncStream(
respImplPtr->asyncStreamKickoffDisabled())));
}
else
{
LOG_INFO << "Chunking Set CloseConnection !!!";
}

It is common practice to use connection: close to indicate that connection should be closed after processing is finished*, meaning - after HTTP response stream is done.

In our setup, we needed to patch drogon like this: openvinotoolkit/model_server@8ca2918

To Reproduce
Steps to reproduce the behavior:

  1. Start drogon with streaming response endpoint defined
  2. Request with any client including header connection: close
  3. Request is immediately rejected

Expected behavior
Connection is closed after response streaming is finished.

Desktop (please complete the following information):

  • OS: ubuntu, redhat, windows
  • Client: any

More context
We are using Continue VSCode plugin as a client for code completions: https://github.com/continuedev/continue
We use drogon to serve http streaming (code completions), however, this plugin (client) sends connection: close header.

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