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

Avoid deadlock in gevent/urllib3 connection pool (fixes occasional worker heartbeat timeouts) #2813

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions locust/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@
# dont show a massive callstack if trio is not installed
os._exit(1)

from gevent import monkey

if not os.getenv("LOCUST_SKIP_MONKEY_PATCH", None):
from gevent import monkey, queue

monkey.patch_all()

if not os.getenv("LOCUST_SKIP_URLLIB3_PATCH", None):
import urllib3

urllib3.connectionpool.ConnectionPool.QueueCls = queue.LifoQueue
# https://github.com/locustio/locust/issues/2812

from ._version import version as __version__
from .contrib.fasthttp import FastHttpUser
from .debug import run_single_user
Expand Down
Loading