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

Locust insists on using IPv6 despite being in an IPv4 stack. #2689

Closed
2 tasks done
axot opened this issue Apr 25, 2024 · 4 comments · Fixed by #2715
Closed
2 tasks done

Locust insists on using IPv6 despite being in an IPv4 stack. #2689

axot opened this issue Apr 25, 2024 · 4 comments · Fixed by #2715
Labels

Comments

@axot
Copy link

axot commented Apr 25, 2024

Prerequisites

Description

I have an environment that is IPv4-only, but there is an IPv6 address listed in /etc/hosts. When I try to connect to the master using the following command, it results in an error:

# locust -f ./p4_basic_code.py --worker --master-host locust-master -L DEBUG
[2024-04-25 06:24:31,138] ip-192-168-0-235.ap-northeast-3.compute.internal/DEBUG/locust.runners: Failed to connect to master locust-master:5557, retry 1/60.

By changing self.socket.setsockopt(zmq.IPV6, 1) to 0 resolves the issue.

# cat /etc/hosts
127.0.0.1 localhost
192.168.0.235 ip-192-168-0-235.ap-northeast-3.compute.internal
127.255.0.1 locust-master
2600:f0f0:0:0:0:0:0:1 locust-master

I recommend detecting whether the current environment supports IPv6 before enabling it.

Command line

locust -f ./p4_basic_code.py --worker --master-host locust-master -L DEBUG

Locustfile contents

N/A

Python version

3.11

Locust version

2.26.0

Operating system

Debian 12

@axot axot added the bug label Apr 25, 2024
@cyberw
Copy link
Collaborator

cyberw commented Apr 25, 2024

Latest locust version is 2.26, start by updating. If that doesnt work, maybe you could provide a PR?

@axot
Copy link
Author

axot commented Apr 25, 2024

Hi, I've verified that the issue persists in the latest version 2.26.0. I'll check if I can submit a pull request."

@axot
Copy link
Author

axot commented Apr 25, 2024

FYI, use version 2.20.0 as a temporary solution.

@cyberw
Copy link
Collaborator

cyberw commented May 16, 2024

Can you try out the suggested fix and see if it works for you? (pip install --pre -U locust)

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

Successfully merging a pull request may close this issue.

2 participants