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

Eventlet retirement #6128

Open
nzlosh opened this issue Feb 7, 2024 · 3 comments
Open

Eventlet retirement #6128

nzlosh opened this issue Feb 7, 2024 · 3 comments

Comments

@nzlosh
Copy link
Contributor

nzlosh commented Feb 7, 2024

SUMMARY

As reported by @cognifloyd in slack: the eventlet team has announced their intention to retire the project. https://github.com/eventlet/eventlet?tab=readme-ov-file#warning This will have significant implications for the StackStorm project as the code base is architected and designed around eventlet and the synchronous programming model.

@guzzijones
Copy link
Contributor

gevent has monkey patching.

@cognifloyd
Copy link
Member

cognifloyd commented Feb 13, 2024

I prefer using standardized asyncio.

I consider monkey patching to be an anti-pattern as it makes debugging very difficult (was it actually monkey patched? Did something reload the code effectively undoing the monkey patch?).

Another reason to use asyncio: Once we implement StackStorm/community#8 the chatops layer will use asyncio since OpsDroid uses asyncio.

I think the way to migrate to asyncio is to migrate one service at a time. That might mean we have a separate async-compatible st2common-compatible library, slowly migrating the dependencies of each service from the sync to the async lib.

Also, the eventlet folks are working on tools to allow asyncio and eventlet to live in the same process, thus smoothing out the migration path. Depending on how that goes, and when it completes, that might also be a big help:

As far as gevent: That will probably be a shorter leap, as support is already partially stubbed in. Any direct imports of eventlet should migrate to using this file instead (if possible):
https://github.com/StackStorm/st2/blob/master/st2common/st2common/util/concurrency.py
And the monkey_patch code would need to be updated to support gevent:
https://github.com/StackStorm/st2/blob/master/st2common/st2common/util/monkey_patch.py

@guzzijones
Copy link
Contributor

I also dislike monkey patching and would prefer a service by service migration to asyncio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants