-
-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Using websocket causes socket leaks in nginx #207
Comments
I believe you're absolutely correct @andreymal, the websockets do appear to be left open it seems (disregarding the nginx entirely). I think they time out eventually, but a proactive approach is needed. I think I've found a solution but I need to do a bit more testing first. |
@andreymal A fix for this has just been released in v1.10.0. Please confirm this solves your issue? Thanks. |
@axllent yes 👍 (but using |
#207) This prevents against malicious buffer overflows.
Awesome, thanks for the quick feedback, and the note re: |
#207) This prevents against malicious buffer overflows.
Just a FYI - the switch to |
I use nginx with configuration similar to this:
and after these steps:
I've noticed that restarting nginx is taking longer than usual. I checked
/var/log/nginx/error.log
and found this:I tested several other projects that also use websockets, but could not reproduce it. Only Mailpit causes this error.
I think this is because, unlike other projects, Mailpit doesn't try to read anything from the websocket and therefore doesn't know it's already closed.
If my assumption is correct, this error could be solved by adding a loop that reads the websocket and does nothing else, something like (disclaimer — I'm not a Go expert):
The text was updated successfully, but these errors were encountered: