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

Monkey-patching may also silently lead to incorrect behaviour on Python 3.7 #8164

Closed
tooptoop4 opened this issue Apr 6, 2020 · 4 comments
Closed
Labels
kind:bug This is a clearly a bug

Comments

@tooptoop4
Copy link
Contributor

[2020-04-06 08:58:58 +0000] [4986] [INFO] Booting worker with pid: 4986 /home/ec2-user/venv/local/lib/python3.6/site-packages/gunicorn/workers/ggevent.py:65: MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. It may also silently lead to incorrect behaviour on Python 3.7. Please monkey-patch earlier. See gevent/gevent#1016. Modules that had direct imports (NOT patched): ['urllib3.util (/home/ec2-user/venv/local/lib/python3.6/site-packages/urllib3/util/init.py)', 'urllib3.util.ssl_ (/home/ec2-user/venv/local/lib/python3.6/site-packages/urllib3/util/ssl_.py)']. monkey.patch_all(subprocess=True) /home/ec2-user/venv/local/lib/python3.6/site-packages/gunicorn/workers/ggevent.py:65: MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. It may also silently lead to incorrect behaviour on Python 3.7. Please monkey-patch earlier. See gevent/gevent#1016. Modules that had direct imports (NOT patched): ['urllib3.util (/home/ec2-user/venv/local/lib/python3.6/site-packages/urllib3/util/init.py)', 'urllib3.util.ssl_ (/home/ec2-user/venv/local/lib/python3.6/site-packages/urllib3/util/ssl_.py)']. monkey.patch_all(subprocess=True) [2020-04-06 08:58:58,803] {init.py:51} INFO - Using executor LocalExecutor [2020-04-06 08:58:58,805] {dagbag.py:403} INFO - Filling up the DagBag from /home/ec2-user/airflow/dags

@tooptoop4 tooptoop4 added the kind:bug This is a clearly a bug label Apr 6, 2020
@boring-cyborg
Copy link

boring-cyborg bot commented Apr 6, 2020

Thanks for opening your first issue here! Be sure to follow the issue template!

@kaxil
Copy link
Member

kaxil commented Apr 6, 2020

The description is unreadable. Please fix the description and follow issue template

@ashb
Copy link
Member

ashb commented Apr 8, 2020

Closing as invalid -- that error is not being reported by Airflow, but by gunicorn when using gevent worker, and most of all does not indicate a problem.

If this is causing any actual problems then please give more details.

@ashb ashb closed this as completed Apr 8, 2020
@zobnec
Copy link

zobnec commented May 16, 2020

This also happened to me.I use a celery worker start a dag and use gevent monkey path in dag code.I can run dag by python command, but with airflow celery worker it reports that (NOT patched): ['urllib3.util...]; So I added gevent monkey path Code at the top of dagbag.py, Just like this and solve it:

import gevent
from gevent import monkey, pool

monkey.patch_all()
import hashlib
import imp
import importlib```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug This is a clearly a bug
Projects
None yet
Development

No branches or pull requests

4 participants