tinyproxy / tinyproxy

tinyproxy - a light-weight HTTP/HTTPS proxy daemon for POSIX operating systems
GNU General Public License v2.0
4.67k stars 645 forks source link

open connections are not closed #518

Closed DivyaPadakandla closed 7 months ago

DivyaPadakandla commented 7 months ago

Tinyproxy version

Tinyproxy version tinyproxy 1.11.1

Issue

timeout 10 max clients 2500

timeout doesn't kill the open connections, once the open connections reach 2500 the proxy stops working. as mentioned in previous issue https://github.com/tinyproxy/tinyproxy/issues/509 kill and restarting would help but it is impacting the application functionality

Thanks

rofl0r commented 7 months ago

timeout handling was fixed in 79d0b0fa79249a714cbb1992d597e21adc30b16e. my local tinyproxy has maxclients 100 and is running > 6 months without issues. it could be possible that there is still some cornercase bug regarding the timeout handling, but apparently it is only hit with clients doing something extraordinary. can you provide some testcase client (python script, or whatever) that let's me reproduce this issue ? if not, at least provide some info about the client accessing your proxy.

DivyaPadakandla commented 7 months ago

in other environments it is working fine for me, recently we have upgraded the kubernetes version of the cluster and the instance we have tinyproxy on is not in the cluster but it is an enterprise instance in the same VPC

rofl0r commented 7 months ago

if the problem happens only in a specific environment (OS, settings, virtualization) it's likely the bug is to be found there. without knowing any details about that environment, including the sort of client accessing the proxy, it's next to impossible to figure out what's going on.

DivyaPadakandla commented 7 months ago

getting this error while doing tinyproxy -d -c tinyproxy.conf ERROR: Syntax error on line 154 Unable to parse config file. Not starting.

would resolving that error help

DivyaPadakandla commented 7 months ago

by seeing the other threads I have tried the following tinyproxy -d -c tinyproxy.conf ERROR: Syntax error on line 154 Unable to parse config file. Not starting.

lsof | wc -l

24949

ls -l | wc -l

3 yum --showduplicate list tinyproxy Loaded plugins: extras_suggestions, langpacks, priorities, update-motd 227 packages excluded due to repository priority protections Installed Packages tinyproxy.x86_64 1.8.3-2.el7 @epel Available Packages tinyproxy.x86_64 1.8.4-2.el7 epel

DivyaPadakandla commented 7 months ago

lsof | wc -l

34021

sudo lsof | wc -l

34114

ls -l | wc -l

1020

rofl0r commented 7 months ago

your problem is the ancient tinyproxy version shipped on that OS. you need to compile latest tinyproxy from source instead.

DivyaPadakandla commented 7 months ago

Can you help me with removing all the old versions on the OS

DivyaPadakandla commented 7 months ago

when I do Tinyproxy version it shows 1.11.1

DivyaPadakandla commented 7 months ago

did you infer that I am on old version from this yum --showduplicate list tinyproxy Loaded plugins: extras_suggestions, langpacks, priorities, update-motd 227 packages excluded due to repository priority protections Installed Packages tinyproxy.x86_64 1.8.3-2.el7 @epel Available Packages tinyproxy.x86_64 1.8.4-2.el7 epel

DivyaPadakandla commented 7 months ago

@rofl0r

DivyaPadakandla commented 7 months ago

where can I change the path to direct the config to take the particular version of installed tinyproxy

DivyaPadakandla commented 7 months ago

[root@ip-add bin]# ls -ltr total 408 -rwxr-xr-x 1 root root 417256 Nov 13 19:42 tinyproxy [root@ip-add bin]# systemctl status tinyproxy.service ● tinyproxy.service - Startup script for the tinyproxy server Loaded: loaded (/usr/lib/systemd/system/tinyproxy.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Mon 2023-11-13 19:52:39 UTC; 1min 58s ago Process: 11447 ExecStart=/usr/local/bin/tinyproxy -c /etc/tinyproxy/tinyproxy.conf (code=exited, status=70) Main PID: 3466 (code=killed, signal=KILL)

Nov 13 19:52:39 ip-add systemd[1]: Starting Startup script for the tinyproxy server... Nov 13 19:52:39 ip-add tinyproxy[11447]: ERROR: Syntax error on line 154 Nov 13 19:52:39 ip-add tinyproxy[11447]: Unable to parse config file. Not starting. Nov 13 19:52:39 ip-add systemd[1]: tinyproxy.service: control process exited, code=exited status=70 Nov 13 19:52:39 ip-add systemd[1]: Failed to start Startup script for the tinyproxy server. Nov 13 19:52:39 ip-add systemd[1]: Unit tinyproxy.service entered failed state. Nov 13 19:52:39 ip-add systemd[1]: tinyproxy.service failed. [root@ip-add bin]# yum --showduplicate list tinyproxy Loaded plugins: extras_suggestions, langpacks, priorities, update-motd 227 packages excluded due to repository priority protections Installed Packages tinyproxy.x86_64 1.8.3-2.el7 @epel Available Packages tinyproxy.x86_64 1.8.4-2.el7 epel [root@ip-add bin]# tinyproxy -version tinyproxy 1.11.1

rofl0r commented 7 months ago

use yum to uninstall distro's tinyproxy, then use ./configure --prefix=/usr ; make ; sudo make install in tinyproxy source dir to install new tinyproxy into system default path.