Interruption in data transfer during long tcp sessions in sing-box ss server >1.4.0

Following the release of sing-box 1.4.0, when sing-box used as shadowsocks server tcp data transfer tends to freeze when there is a spike in transmitted traffic in long sessions.

Some of the scenarios where this issue is observed include:

  1. While tailing long log files through SSH: The SSH session becomes stuck after a few seconds.
  2. During RDP sessions: Similar freezing behavior is noticed when a window is opened or moved. This is likely due to the increase in traffic usage caused by screen redraws.
  3. Turn connections via TCP also gets stuck after a few seconds of sound or video transmission.

This bug has been reproduced across all versions from 1.4.0 through to 1.5.0-rc.4. However, it is not reproducible in versions earlier than 1.4.0. Enabling multiplexing on client(h2mux or smux) seems to fix the problem, and the issue does not present itself under such conditions.

This issue doesn’t seem to be related to the client version. It has been reproduced in both sing-box and xray ss clients. Also, nothing suspicious can be found in the logs.

The issue persists with version 1.6.0-alpha.2

I will create a GitHub issue once I can reproduce it in a test environment and prepare a scenario to do so.

1 Like

We need more information to debug this issue and look forward to your issue.

1 Like

Sure, I will gather all the necessary information and create an issue on GitHub.

Also, reproduced on v1.6.0-beta.4

I’m currently unable to reproduce the issue in my local testing environment. However, the issue persists on my server.

I did some tests and found that the problem arose in version 1.4.0-rc2. In rc1, everything works perfectly.

It appears the issue is related to the modified sniffer timeout logic rather than shadowsocks.

I’m still attempting to reproduce the issue using a simplified configuration.

@nekohasekai

The problem is localized. It disappears when I revert the commit 6dcacf3b5ee in the latest (or any other) version.

Unfortunately, I still can’t reproduce it with a simplified config. I will delve deeper into this issue.