You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
Pull Request resolved: #267
As we did with StreamActor before it, it is good to run PythonActor handlers on one thread consistently, since a lot of the Python code we have assumes that is called from a single thread, makes use of thread-local state, etc.
So, we spawn one thread per PythonActor for it to run on.
TODO: this does NOT preserve thread-local state between async endpoints and sync endpoints, which is a huge issue. I think the correct solution there is detect whether an actor has any async endpoints, and if so, switch to a mode where absolutely all Python code is run on the asyncio event loop. That's a deeper refactor though, so will do this to unblock for now.
Reviewed By: mariusae
Differential Revision: D76603819
fbshipit-source-id: d8101084fe41a10d163a26dd450e1e0e4a2614ac
0 commit comments