-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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
'Too many open files' on Android 6.0-8.1 #2796
Comments
Dumped File descriptor info, a DNS query from APP makes shadowsocks create at least 2 handle in VpnService, first one is
|
These seem normal. These fds are not closed? Does your server connection work properly? |
Most of them will be closed, or crash because of Key point of this issue is ifferent timeout in Java and Rust side: But I still don't know why socket of |
It is technically not a leak if they are eventually closed? Although I am down to tweak timeouts. Where did you find the 90s timeout? |
90s timeout is an experience value by the log, it's not accurate. |
Sounds good. I will take a look sometime. Does this issue go away if you use the "All" Route? |
Currently I use ACL with Bypass Lan. I think this issue doesn't exists in 'All' route case since DNS query will not be passed to Java side (so no extra FDs created) and it has 5s timeout. And, maybe unix socket connection reuse ( ref #2751 ) is still needed? Because rust will make 2-3 DNS queries for 1 connection, there still has very little chance to create over 1000 FDs before the 5s timeout. |
@Mygod |
Closing as Android versions too old. |
LocalDnsWorker.accept
will throwBroken pipe
when UDP is filtered or network is disconnected.And then, if DNS query continue incoming, the unix socks handle of
VpnService
process will exceeds handle limit which is 1024 (32768 on Android 9.0 and newer), so finallyVpnService
process will get exceptionToo many opened files
andBad file descriptor
everywhere.Meanwhile, because Java side UDP DNS query is timeout, sslocal will send TCP DNS query with 'java protected' socket, which create same amount of socket handles in sslocal. (Why sslocal makes a TCP query again?)
As a result, both
VpnService
and sslocal crash at random time.Logs:
org.shadowsocks.xx_issue_19bc73ad993aad4d5fe278892d584231_error_session_61279182004D00013C85A04AC568A81B_DNE_5_v2.log
org.shadowsocks.xx_issue_274bc2d242720049275714683d3d4cc5_error_session_6127B31401C900010D2CF9C39D05D8E2_DNE_0_v2.log
org.shadowsocks.xx_issue_2d5e1ddcbf72ff6f25953b540bd48ff5_error_session_6127C4D9026F00011AC0A04AC568A81B_DNE_0_v2.log
The text was updated successfully, but these errors were encountered: