Skip to content
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

Reload produces duplicated listening ports on high load #970

Open
Shawn-Tong opened this issue Sep 3, 2023 · 1 comment
Open

Reload produces duplicated listening ports on high load #970

Shawn-Tong opened this issue Sep 3, 2023 · 1 comment
Labels

Comments

@Shawn-Tong
Copy link

Shawn-Tong commented Sep 3, 2023

I open an HTTP port 8080 and a Socks port 1080 on my 3proxy service.

ss -lntp | head -1; ss -ltnp | grep 3proxy
State      Recv-Q Send-Q Local Address:Port               Peer Address:Port             
LISTEN     0      2376         *:8080                     *:*                   users:(("3proxy",pid=33719,fd=7352))
LISTEN     0      1001         *:1080                     *:*                   users:(("3proxy",pid=33719,fd=1841))

But it will produce duplicated listening ports sometimes (on high load) after reloading the config file by /bin/kill -s USR1

/bin/kill -s USR1 `cat /var/run/3proxy/3proxy.pid`
ss -lntp | head -1; ss -ltnp | grep 3proxy
State      Recv-Q Send-Q Local Address:Port               Peer Address:Port             
LISTEN     0      2376         *:8080                     *:*                   users:(("3proxy",pid=33719,fd=7352))
LISTEN     2377   2376         *:8080                     *:*                   users:(("3proxy",pid=33719,fd=1600))
LISTEN     0      1001         *:1080                     *:*                   users:(("3proxy",pid=33719,fd=1841))
LISTEN     246    1001         *:1080                     *:*                   users:(("3proxy",pid=33719,fd=564))

Then the 3proxy service will stop working.

curl example.com --proxy PROXY_IP:8080
(no response)

The problem happened in the new version (Jul 13, 2023). I didn't meet the problem in the old version (April 25, 2022).

@z3APA3A
Copy link
Collaborator

z3APA3A commented Sep 5, 2023

Duplicate listening port on configuration reload is expected behavior and may appear for few seconds. New config is started before old config finishes to prevent the break. If proxy stops to function on configuration reload, it probably indicates the lack of resources or broken configuration (proxy can not complete loading new configuration). Check you prevent race conditions for writing configuration file on configuration reload. See https://3proxy.ru/highload.asp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants