Skip to content

Commit

Permalink
Stop hang when use mongo SSL (#5240)
Browse files Browse the repository at this point in the history
* Stop hang when use mongo SSL

* Fix black

* Update CHANGELOG.rst

* Update wsgi.py

Perform monkey patch as the very first thing - even before importing os module.

* Remove testing change, also run micro benchmarks under 3.8.

Co-authored-by: Tomaz Muraus <tomaz@tomaz.me>
  • Loading branch information
amanda11 and Kami authored Apr 22, 2021
1 parent 78ae28e commit 5fa48d1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/microbenchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 * * *'

Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ Changed

Contributed by @chadpatt .

* Monkey patch on st2stream earlier in flow #5240

Contributed by Amanda McGuinness (@amanda11 Ammeon Solutions)

Improvements
~~~~~~~~~~~~

Expand Down
5 changes: 0 additions & 5 deletions st2stream/st2stream/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = {
Expand Down
4 changes: 4 additions & 0 deletions st2stream/st2stream/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5fa48d1

Please sign in to comment.