ndt-server icon indicating copy to clipboard operation
ndt-server copied to clipboard

ndt7: see if we can close *os.File on UPGRADE error

Open bassosimone opened this issue 6 years ago • 1 comments

Currently, the code lets the cache eviction mechanism handle closing a *os.File that is bound to a socket for which the WebSocket UPGRADE failed. We can probably do better, by obtaining the *os.File and closing it early, but that will require to hijack the HTTP connection.

If we knew we were using http/1.1 for sure, we could just write a reply. The possibility of being serving a http2 request makes the whole matter slightly more complex.

This issue is about double thinking about whether this is actually an issue, and, if so, implementing a low-complexity fix to improve the situation. It may well be that it's fine to just let the cache take care of the cached *os.File. However, it remains to understand whether keeping the *os.File cached also keeps the TCP connection open for some more time.

bassosimone avatar Sep 21 '18 10:09 bassosimone

We are not too worried about this. I'm unassigning myself for now.

bassosimone avatar Sep 25 '19 21:09 bassosimone