Closed samuong closed 5 years ago
This should be fixed by 0904ccc. I've been running with this change locally for a few days now, and it appears to clean up all the leaked file descriptors.
In case it's useful in the future, the number of open connections (in each direction of a CONNECT tunnel) can be found using something like lsof -Pn -c alpaca | awk '!/ESTABLISHED/{next} /:3128/{proxy++;next} {tunnel++} END{printf "%d (proxy) %d (tunnel)\n", proxy, tunnel}'
.
A long-running Alpaca session ended up not being able to proxy traffic, and had the following error messages in the logs:
It looks like Alpaca is leaking connections, maybe due to not closing one half of the CONNECT requests (ref ProxyHandler.handleConnect).
In addition to fixing the leak, there should be better visibility into what's going on in terms of open connections.