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

Worker sometimes fails to send heartbeat after upgrade to urllib3>=1.26.16 #2812

Closed
2 tasks done
tdadela opened this issue Jul 22, 2024 · 1 comment · Fixed by #2813
Closed
2 tasks done

Worker sometimes fails to send heartbeat after upgrade to urllib3>=1.26.16 #2812

tdadela opened this issue Jul 22, 2024 · 1 comment · Fixed by #2813
Labels

Comments

@tdadela
Copy link
Contributor

tdadela commented Jul 22, 2024

Prerequisites

Description

After upgrade of urllib3 (indirect dependency of Locust) to version >=1.26.16 locust started working improperly.
After change (for one of our test, 80 processes on 20 machines, duration: 1 hour) there is ~50% probability of (one or more) worker disconnections "Worker XXX failed to send heartbeat, setting state to missing".
After forking locust to add more logs, it became clear it happens because workers sometimes stop sending heartbeat. (It's not for example network issue. It isn't also high CPU usage).

Changes in urllib3:

Issues:

Credit to @domik82 for finding them.

After applying this solution, worker disconnections disappeared. (10 performance tests with 80 processes on 20 machines, duration: 1 hour)

Command line

locust -f locustfile.py

Locustfile contents

N/A

Python version

3.11.1

Locust version

2.29.1 (and older)

Operating system

CentOS 7

@tdadela tdadela added the bug label Jul 22, 2024
tdadela added a commit to tdadela/locust that referenced this issue Jul 22, 2024
@cyberw
Copy link
Collaborator

cyberw commented Jul 22, 2024

Amazing work figuring it out. Will you make a PR, or do you want me to do it? You can title it something like "avoid deadlock in gevent/urllib3 connection pool (fixes worker heartbeat timeouts)"

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