diff --git a/.github/workflows/microbenchmarks.yaml b/.github/workflows/microbenchmarks.yaml index e3a0b71ba3..72d050d38b 100644 --- a/.github/workflows/microbenchmarks.yaml +++ b/.github/workflows/microbenchmarks.yaml @@ -3,12 +3,6 @@ name: Micro Benchmarks on: - pull_request: - type: [opened, reopened, edited] - branches: - # Only for PRs targeting those branches - - master - - v[0-9]+.[0-9]+ schedule: - cron: '30 3 * * *' @@ -43,6 +37,11 @@ jobs: nosetests_node_total: 1 nosetests_node_index: 0 python-version: '3.6' + - name: 'Microbenchmarks' + task: 'micro-benchmarks' + nosetests_node_total: 1 + nosetests_node_index: 0 + python-version: '3.8' services: mongo: image: mongo:4.4 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index de94c165ec..4232e28ffc 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -234,6 +234,10 @@ Changed Contributed by @chadpatt . +* Monkey patch on st2stream earlier in flow #5240 + + Contributed by Amanda McGuinness (@amanda11 Ammeon Solutions) + Improvements ~~~~~~~~~~~~ diff --git a/st2stream/st2stream/app.py b/st2stream/st2stream/app.py index e61684b7bf..0235d1ad56 100644 --- a/st2stream/st2stream/app.py +++ b/st2stream/st2stream/app.py @@ -34,7 +34,6 @@ from st2common.middleware.instrumentation import RequestInstrumentationMiddleware from st2common.middleware.instrumentation import ResponseInstrumentationMiddleware from st2common.router import Router -from st2common.util.monkey_patch import monkey_patch from st2common.constants.system import VERSION_STRING from st2common.service_setup import setup as common_setup from st2common.util import spec_loader @@ -47,10 +46,6 @@ def setup_app(config={}): is_gunicorn = config.get("is_gunicorn", False) if is_gunicorn: - # Note: We need to perform monkey patching in the worker. If we do it in - # the master process (gunicorn_config.py), it breaks tons of things - # including shutdown - monkey_patch() st2stream_config.register_opts(ignore_errors=True) capabilities = { diff --git a/st2stream/st2stream/wsgi.py b/st2stream/st2stream/wsgi.py index 14d847e2a1..14c673a9ee 100644 --- a/st2stream/st2stream/wsgi.py +++ b/st2stream/st2stream/wsgi.py @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +from st2common.util.monkey_patch import monkey_patch + +monkey_patch() + import os from st2stream import app