From: Vallari Agrawal Date: Tue, 13 Feb 2024 13:46:01 +0000 (+0530) Subject: teuthology/__init__.py: don't patch threads when running via teuthology_api X-Git-Tag: 1.2.0~55^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d0202a74cf11b4ceee64210a2e0c5a35aa5afca1;p=teuthology.git teuthology/__init__.py: don't patch threads when running via teuthology_api The project [teuthology-api](https://github.com/ceph/teuthology-api) requires threads to be not patched. Currently, we are using "teuth-api" branch of teuthology where threads are not patched. With this commit, we'll be able to use the "main" branch as a dependency. Signed-off-by: Vallari Agrawal --- diff --git a/teuthology/__init__.py b/teuthology/__init__.py index d84f25a2..7cb5bf03 100644 --- a/teuthology/__init__.py +++ b/teuthology/__init__.py @@ -1,5 +1,5 @@ from __future__ import print_function -import os +import os, sys try: import importlib.metadata as importlib_metadata except ImportError: @@ -24,10 +24,15 @@ try: except ImportError: pass from gevent import monkey +patch_threads=True +for arg in sys.argv: + if "teuthology_api" in arg: + patch_threads=False monkey.patch_all( dns=False, # Don't patch subprocess to avoid http://tracker.ceph.com/issues/14990 subprocess=False, + thread=patch_threads, ) import sys from gevent.hub import Hub