Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

transocks dead lock when the socks met some issues #23

Open
xixixihaha opened this issue May 28, 2020 · 2 comments
Open

transocks dead lock when the socks met some issues #23

xixixihaha opened this issue May 28, 2020 · 2 comments

Comments

@xixixihaha
Copy link

xixixihaha commented May 28, 2020

The socks proxy met some network issues, transaocks reported the issue but failed to reconnect to the proxy anymore even the proxy and network resumed working. looks like there is some issue about file handle as "GetOriginalDST failed" reported by transocks. Killing the transocks process and restart solved the issue.

Here is the log.
2020-05-28T13:36:06.938145Z J4205-me transocks error: "failed to connect to proxy server" client_addr="114.245.228.53:34304" dest_addr="96.45.191.222:21368" error="socks connect tcp 127.0.0.1:1080->96.45.191.222:21368: EOF" request_id="3a2dfc56-7762-2e55-d168-5c48fc8ffd3e" type="access" pid=11846
2020-05-28 21:36:06 ERROR: remote_recv_cb_recv: Connection reset by peer
2020-05-28T13:36:06.944690Z J4205-me transocks error: "failed to connect to proxy server" client_addr="114.245.228.53:49896" dest_addr="162.211.223.104:21368" error="socks connect tcp 127.0.0.1:1080->162.211.223.104:21368: EOF" request_id="3d2dfc56-7762-2e55-d168-5c48fc8ffd3e" type="access" pid=11846
2020-05-28 21:36:06 [simple-obfs] ERROR: remote_recv_cb_recv: Connection reset by peer
2020-05-28T13:36:09.247794Z J4205-me transocks error: "failed to connect to proxy server" client_addr="114.245.228.53:48854" dest_addr="13.35.102.189:443" error="socks connect tcp 127.0.0.1:1080->13.35.102.189:443: EOF" request_id="3c2dfc56-7762-2e55-d168-5c48fc8ffd3e" type="access" pid=11846
2020-05-28T13:36:10.054968Z J4205-me transocks error: "failed to connect to proxy server" client_addr="114.245.228.53:34410" dest_addr="96.45.191.222:21368" error="socks connect tcp 127.0.0.1:1080->96.45.191.222:21368: EOF" request_id="062dfc56-7762-2e55-d168-5c48fc8ffd3e" type="access" pid=11846
2020-05-28 21:36:10 ERROR: remote_recv_cb_recv: Connection reset by peer
2020-05-28T13:36:10.053874Z J4205-me transocks error: "failed to connect to proxy server" client_addr="114.245.228.53:49998" dest_addr="162.211.223.104:21368" error="socks connect tcp 127.0.0.1:1080->162.211.223.104:21368: EOF" request_id="092dfc56-7762-2e55-d168-5c48fc8ffd3e" type="access" pid=11846
2020-05-28 21:36:10 [simple-obfs] ERROR: remote_recv_cb_recv: Connection reset by peer
2020-05-28T13:36:12.948616Z J4205-me transocks error: "failed to connect to proxy server" client_addr="114.245.228.53:48956" dest_addr="13.35.102.189:443" error="socks connect tcp 127.0.0.1:1080->13.35.102.189:443: EOF" request_id="082dfc56-7762-2e55-d168-5c48fc8ffd3e" type="access" pid=11846
2020-05-28T13:36:12.981262Z J4205-me transocks error: "failed to connect to proxy server" client_addr="114.245.228.53:50088" dest_addr="162.211.223.104:21368" error="socks connect tcp 127.0.0.1:1080->162.211.223.104:21368: EOF" request_id="122dfc56-7762-2e55-d168-5c48fc8ffd3e" type="access" pid=11846
2020-05-28 21:36:12 [simple-obfs] ERROR: remote_recv_cb_recv: Connection reset by peer
2020-05-28T13:36:13.128439Z J4205-me transocks error: "failed to connect to proxy server" client_addr="114.245.228.53:35562" dest_addr="104.16.153.71:443" error="socks connect tcp 127.0.0.1:1080->104.16.153.71:443: EOF" request_id="152dfc56-7762-2e55-d168-5c48fc8ffd3e" type="access" pid=11846
2020-05-28T13:36:16.112691Z J4205-me transocks error: "GetOriginalDST failed" client_addr="114.245.228.53:57912" error="file tcp 127.0.0.1:1082->114.245.228.53:57912: fcntl: too many open files" request_id="7e2efc56-7762-2e55-d168-5c48fc8ffd3e" type="access" pid=11846
2020-05-28 21:36:16 ERROR: remote_recv_cb_recv: Connection reset by peer

@xixixihaha xixixihaha changed the title transacks dead lock when the socks met some issue transocks dead lock when the socks met some issue May 28, 2020
@xixixihaha xixixihaha changed the title transocks dead lock when the socks met some issue transocks dead lock when the socks met some issues May 28, 2020
@ymmt2005
Copy link
Member

ymmt2005 commented Nov 4, 2020

error="file tcp 127.0.0.1:1082->114.245.228.53:57912: fcntl: too many open files"

This indicates there are too many open files. transocks might be leaking in some cases?

@nishitaniyuki
Copy link
Contributor

nishitaniyuki commented Nov 5, 2020

Maybe something like the following is happening:

  1. No timeout is set to net.Dialer
  2. Something bad happens at the proxy server and a lot of proxy.Dialer.Dial get blocked
  3. Transocks reaches "Max open files" (in Linux the default value of "Max open files" soft limit is set to 1024)
  4. GetOriginalDST returns "fcntl: too many open files" error

We can probably set a timeout to net.Dialer to mitigate it.

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

No branches or pull requests

3 participants