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

Gevent + Urllib3 Recursion Bug (Regression) #409

Closed
TimPansino opened this issue Oct 14, 2021 · 0 comments · Fixed by #410
Closed

Gevent + Urllib3 Recursion Bug (Regression) #409

TimPansino opened this issue Oct 14, 2021 · 0 comments · Fixed by #410

Comments

@TimPansino
Copy link
Contributor

TimPansino commented Oct 14, 2021

Description

After the upgrade to urllib3 in version 7.2.0, a regression for the gevent + urllib3 recursion occurred.

Expected Behavior

Gevent patching after agent initialization should not cause a crash in the agent.

Steps to Reproduce

import newrelic.agent
newrelic.agent.initialize()

from gevent import monkey
monkey.patch_all()

import requests
r = requests.get('https://www.google.com/')
print(r)

Your Environment

gevent==21.8.0
newrelic==7.2.1.168
requests==2.26.0
urllib3==1.26.7

Additional Context

Relevant comment from codebase with links:

# This is a monkey patch for urllib3 + python3.6 + gevent/eventlet.
# Gevent/Eventlet patches the ssl library resulting in a re-binding that causes
# infinite recursion in a super call. In order to prevent this error, the
# SSLContext object should be accessed through the ssl library attribute.
#
#   https://github.com/python/cpython/commit/328067c468f82e4ec1b5c510a4e84509e010f296#diff-c49248c7181161e24048bec5e35ba953R457
#   https://github.com/gevent/gevent/blob/f3acb176d0f0f1ac797b50e44a5e03726f687c53/src/gevent/_ssl3.py#L67
#   https://github.com/shazow/urllib3/pull/1177
#   https://bugs.python.org/issue29149
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants