question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Investigate issues with gevent.monkey.patch_all()

See original GitHub issue

Is your feature request related to a problem? Please describe.

Users on an older version of gevent (1.5.0) reported that running gevent.monkey.patch_all() breaks workflow asyncio.

Describe the solution you’d like

  • Replicate the error on that gevent version (a simple workflow is probably fine)
  • Upgrade gevent to see if it still occurs
    • If not, essentially bisect to find offending version minimum and maybe document in README
    • If so, find workaround and document in README

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alecgorgecommented, Jun 29, 2022

Thanks for the context. I am planning on testing our gevent setup with Temporal. I will report back the results w/gevent version once I have done so

0reactions
cretzcommented, Oct 10, 2022

Also, changing _(s|g)et_running_loop to (s|g)et_event_loop is a good idea to prevent changes in the private API from breaking things.

Completely agree, but there was something w/ the default event loop policy on some platform I think was causing me problems. But I forget what and I didn’t document it, so will definitely try to move back to all public API.

The only approach I can think of […]

We really have to keep our custom event loop. It’s the underpinning of what makes workflows work well.

Maybe we can have a similar monkey patch that overrides gevent for the life of the run_once and then puts it back after. I’ll have to check gevent, but surely we’re not the first that have wanted to do advanced asyncio loop management in a gevent-enabled process. I’ll have to dig into what they really do. I only need a short synchronous window to own the loop on a thread run.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gevent monkey.patch_all() hangs my application · Issue #1812
I am guessing that this is because gevent has not monkey patched threads. Please correct me if I'm wrong. Concern: As of now,...
Read more >
gevent.monkey – Make the standard library cooperative
The primary interface to this is the patch_all() function, which performs all the available patches. It accepts arguments to limit the patching to...
Read more >
Seeing MonkeyPatching error while running newrelic-admin ...
I am running in to MonkeyPatching issue. Error: ... Found problems running newrelic-admin with python 3.6, gevent and gunicorn.
Read more >
Gevent monkey patching - OverflowError - Stack Overflow
I tried to run my Flask project with gevent on Python3.7 on Raspberry Pi with gevent.monkey.patch_all() on the first line.
Read more >
What is gevent?
libev attempts to resolve some of these problems by not using global variables and use a ... To patch all default modules, call...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found