Skip to content

Commit

Permalink
fix: worker disconnections when urllib3>=1.26.16
Browse files Browse the repository at this point in the history
  • Loading branch information
tdadela committed Jul 22, 2024
1 parent c4b6571 commit 593fb54
Showing 1 changed file with 8 additions and 2 deletions.
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

0 comments on commit 593fb54

Please sign in to comment.