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

HttpServer continues processing requests after closing httpconnection #3245

Closed
AngLi2 opened this issue Jan 7, 2020 · 3 comments
Closed
Assignees
Labels
Milestone

Comments

@AngLi2
Copy link

AngLi2 commented Jan 7, 2020

It looks like httpserver will continue processing requests after closing httpconnection in #2542

We closes the connection in connectionHandler when a new connection happens above the limit. But the requestHandler will continue processing.

So for the client side, it won't get any response because of the closed connection but the httpServer has already handled the request, which is out of our expectations.

I want to stop processing any request after the httpconnection closed, any good idea?

Thanks

@vietj
Copy link
Member

vietj commented Jan 7, 2020

can you provide a reproducer example ?

@AngLi2
Copy link
Author

AngLi2 commented Jan 8, 2020

Here is an example:

HttpServer httpServer = createHttpServer();
httpServer.requestHandler(mainRouter);
httpServer.connectionHandler(connection -> {
    if (connectionCount > connectionLimit) {
        connection.close();
    }
});

We expect the requestHandler not to handle the request if the connection closed. But it will still handle the request. Any good idea to deal with that?

@vietj
Copy link
Member

vietj commented Jan 8, 2020

it seems like a bug, we should check the connection is not closed after the handler has been called.

@vietj vietj added the bug label Jan 8, 2020
@vietj vietj self-assigned this Jan 8, 2020
@vietj vietj added this to the 3.8.5 milestone Jan 8, 2020
@vietj vietj closed this as completed Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants