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

RuntimeWarning due to monkey patching with gevent 1.1.0 #86

Closed
vcarel opened this issue Mar 29, 2016 · 3 comments
Closed

RuntimeWarning due to monkey patching with gevent 1.1.0 #86

vcarel opened this issue Mar 29, 2016 · 3 comments
Labels
🙉🙈🙊 gevent some issue likely caused by gevent, not necessarily grequests wontfix

Comments

@vcarel
Copy link

vcarel commented Mar 29, 2016

FYI I wrote this as a comment in the issue #8, but since it's closed, I'm afraid nobody will look at it.

The latest version of gevent - 1.1.0 - introduced a warning message when monkey.patch_all is called multiple times:

grequests.py:21: RuntimeWarning: Patching more than once will result in the union of all True parameters being patched
  curious_george.patch_all(thread=False, select=False)

This happens in my application because both grequests and I call monkey.patch_all.

I don't think libs such as grequests should do monkey patch by themselves. If this is a requirement (and this is one obviously), I'd rather get a warning saying that some part of the standard lib should be monkey patched so that grequests can work. It could also be a failing assertion.

Sure, it's only a warning and it doesn't hurt much. But nobody likes useless warnings, and I'm getting this one at every unit test, every run and in my production logs. This is pretty annoying.

@chuanwu
Copy link

chuanwu commented Apr 8, 2016

I came across this warning too after upgrading gevent from 1.0.1 to 1.1.1.

@spyoungtech
Copy link
Owner

🙈 Sorry you're running into this annoyance. Curious George seems to be getting grequests in all kinds of trouble 🐒. Though, unfortunately, I don't think there is an appropriate solution from grequests.

Firstly, it's a change in gevent that caused this. Not much we can do about that. Perhaps you could submit a PR with gevent to add an option to suppress the warning.

Secondly, whether or not grequests should itself be calling monkey patch is, in my view, a moot point to discuss, because what it suggests is introducing a change that would break all code using grequests to address a warning presented by gevent. Like you mentioned, it's only a warning and it doesn't hurt much. Such a change as you suggest would hurt a lot. 😥

Finally, it should be possible for you to suppress the warning yourself, even if gevent won't provide it as a feature directly. That should help keep your production logs and CI reports clean 👌

@spyoungtech
Copy link
Owner

For now, there's not much to be done here. Eventually, I may test and figure out how to do a more selective patching that may solve you're issue. Mixing two libraries that use gevent is never really an easy affair.

@spyoungtech spyoungtech added the 🙉🙈🙊 gevent some issue likely caused by gevent, not necessarily grequests label Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙉🙈🙊 gevent some issue likely caused by gevent, not necessarily grequests wontfix
Projects
None yet
Development

No branches or pull requests

3 participants