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
Lua: global table to store state between threads #4027
Comments
Is there any update on this feature support? |
Should Envoy have a generic mechanism for filters to share state between workers? This is a common concern. |
We have SharedData in C++. This acts like a global KV store. |
In the Proxy-Wasm C++ SDK. |
Any updates on this issue? Shared state in lua would negate a potential requirement to utilize c++ simply to achieve shared state. |
@patrickcarnahan nobody has showed interest in working on it or made a PR. But I don't think there's a technical reason not to do it. |
This is also available in proxy-wasm-rust SDK and others as well. Now, before diving into understanding how this can be done, I am wondering: did anyone evaluate the response times of a Lua vs non-Lua (like Rust, which I'm using right now) implementation ❔ I'm planning to do this, except that I really wanted to use this set & get shared data feature. Without it in Lua, I think I can happily live with a Rust based implementation, but I'm still curios to see or do and have any comparison results. |
Description:
Lua state is per worker and it will be non-trivial/impossible to share it between threads. A global storage for Lua is to provide a Lua API that wraps a metadata/table that calls into C++ code with proper locking to set/get items in a global table. All Lua code can access global table and share state in different Envoy Lua filters.
The original request is from #4008
The text was updated successfully, but these errors were encountered: