esnet / esnet/iperf

Server hangs endlessly (0.00 Mbits/sec) on sudden client disconnect – Works in 3.14, broken in 3.16+

Open
#1,986 18 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
8.8k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

### iperf3 Version(s)
Working: 3.14

Intermittent: 3.15

Broken: 3.16 and newer

### Operating System / Architecture
Server: Alma Linux 10
Client: Android

### Defect Description
I am encountering a regression in how iperf3 handles sudden client disconnections (specifically with mobile devices losing signal).

When a client device (mobile) abruptly loses connection during a test (e.g., 4G/5G drops or is toggled off), the server instance should detect the loss, report "Connection reset by peer," and return to the listening state.

In versions 3.16 and newer, the server fails to detect the disconnect. Instead of resetting, it hangs indefinitely, printing 0.00 Mbits/sec lines until manually killed.

### Regression / Bisect Info
I have tested multiple versions to isolate the behavior:

v3.14: Works reliably. The server detects the drop immediately, prints iperf3: error - unable to read from stream socket: Connection reset by peer, and waits for a new client.

v3.15: Unreliable. It works sometimes, but occasionally exhibits the hanging behavior.

v3.16+ (up to current): consistently broken. The server never resets and hangs on 0.00 Mbits/sec until the process is killed.

### Steps to Reproduce
Start an iperf3 server: iperf3 -s

Connect a client (a mobile device over 4G or 5G): iperf3 -c -t 100

Midway through the test, simulate a signal loss on the client (e.g., disable 4G/5G data or toggle airplane mode).

Observe Server Output:

Expected (v3.14): Server errors out with "Connection reset" and restarts the listener.

Actual (v3.16+): Server continues running, printing 0.00 Mbits/sec indefinitely.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.