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

[bug] iperf3 python hangs after long time throughput test (>120s) : file descriptors redirecting is stuck #75

Open
rexlim820220 opened this issue Mar 28, 2024 · 0 comments

Comments

@rexlim820220
Copy link

rexlim820220 commented Mar 28, 2024

execution environment

OS: Linux Ubuntu 20.04.6 LTS
Python: 3.8.10
iperf3 version : 3.1.7 (as Iperf server)
iperf3-python version: 0.1.11 (as Iperf client)

issue description

I wrapped iperf3-python toolkit within my python snippet as a client to connect a running iperf servers on 10.10.50.81:64101.

With the following available options for a Client:

    # Test 1: iperf3 -c 10.10.50.81 -u -t 120 -b 1000m -R -p 64101
    cli = iperf3.Client()
    cli.server_hostname = "10.10.50.81"
    cli.port = 64101
    cli.duration = 120
    cli.protocol = "udp"
    cli.bandwidth = 1000000000
    cli.reverse = True
    cli.blksize = 1250
    result1 = cli.run()
    print("Test 1 result:", result1)

    # Test 2: iperf3 -c 10.10.50.81 -u -t 120 -b 200m -p 64101
    cli.server_hostname = "10.10.50.81"
    cli.port = 64101
    cli.duration = 120
    cli.protocol = "udp"
    cli.bandwidth = 2000000000
    cli.reverse = False
    cli.blksize = 1250    
    result2 = cli.run()
    print("Test 2 result:", result2)

However, it keep hanging on "Test 1 result:" even when Iperf server finish traffic.

To trace the reason, I use python3 -m trace --trace phylax_client.py to tell where my python script is hanging,

and the following is the execution log:

image

You can see that the code hang during iperf3.py(70): os.dup2(pipe_in, 1) # stdout, even though iperf server has already finished throughput.

I think this issue might be related to #50. However, the following trick suggested by @perfecto25 doesn't seems to work for me.

    targets = ['server1', 'server2']
    
    for target in targets:
        client = iperf3.Client()
        ## do iperf stuff
        client = None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant