-
Notifications
You must be signed in to change notification settings - Fork 105
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
Client connections are not closed when Tempesta is stopped #116
Comments
Linked with #100, so it's relatively heavy task and we're not it time to deliver it for 0.4. As a temporal workaround (dirty and nasty) - just reboot the system if you need to stop Tempesta. |
I've seen
warning after I start Tempesta, make a request If then client closes connection, server's kernel panics:
|
The fix is also required to finish #228 (comment) : we have to close all active client connections in TfwCfgMod->stop() callback (see f3fc64d#diff-0de6ca483cd4f24745525383f12d374eR335) to guarantee that there is no server socket users when sock_srv runs its stop() callback. Since the issue is also linked with #100, it must be possible to close client connection concurrently with other operations on it. Also server socket can be in process of transferring huge data in response to some client request. So a generic synchronized connection (TfwConnection as well as struct sock) closing must be implemented to satisfy all the requirements. |
Loaded Tempesta has a handful of listening sockets open, a handful of connections to backend servers, and a potentially huge number of client connections at any given time. When Tempesta is stopped, listening sockets, as well as connections to backend servers are closed. However, client connections are not closed at that time. Sockets will eventually be closed by the kernel, but not closing connections by Tempesta leads to memory leak as Tempesta internal data linked to each socket is not released.
The issue is somewhat complicated by the fact that currently Tempesta doesn't keep track of client connections. A solution need to be developed that takes the minimal amount of resources, both CPU and memory.
The text was updated successfully, but these errors were encountered: