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

Unique identifiers of worker contexts in multithreaded environment #78

Open
vchigrin opened this issue Feb 10, 2025 · 0 comments
Open

Comments

@vchigrin
Copy link

Following сomment relates to Envoy proxy (I don't know much about other proxy-wasm implementations).

Multi-threaded servers may use separate WASM runtime for each worker thread. At least in Envoy identifiers, provided in proxy_on_context_create are unique for that worker thread (that is, in simplest scenario, all root contexts will get identifier equal to 1). Thus it impossible to distinguish instances of the HTTP filter contexts, running on different threads.

Why users may want distinguish them: Suppose system where some plugin has one context marked as singleton (registered in bootstrap_extensions config section), and multiple contexts registered as HTTP filter. If singleton context wants send data to worker contexts, then each worker context must have some unique shared queue name (since as far as I can see, proxy_on_queue_ready notifications will arrive to those instance that made most recent call to proxy_register_shared_queue ). There are no simple way for generating such unique queue names for HTTP filter context instance in each worker thread.

I think providing identifier unique for entire proxy process will help solve this issue.

If I missed something and proxy-wasm API already have ways for accomplishing this task, I will be very grateful is somebody points to them.

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

1 participant