feat: support custom_lua_shared_dict in global lua {} block and stream {} block#13286
Open
houtengfei193-spec wants to merge 1 commit intoapache:masterfrom
Open
Conversation
Author
|
Hi @nic-6443 @shreemaan-abhishek, could you help approve the CI workflow for this PR? It's a small change (size:M) extending |
Author
|
@membphis @tzssangglass @spacewander Could you please review this PR? All CI checks have passed. This PR adds support for
This resolves the need to manually modify All 18 CI checks have passed (1 skipped for DockerHub build which is expected for PRs). Thank you for your time and review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Currently,
custom_lua_shared_dictonly works in thehttp {}block (added in #5030). This PR extends the same mechanism to:lua {}block (requiresapisix-nginx-module) — for shared dicts accessible by both HTTP and Stream subsystemsstream {}block — for stream-only shared dictsWhy
Users who need cross-subsystem shared dicts (e.g., for lifecycle management, custom metrics, global state sharing) currently have to manually patch
ngx_tpl.lua. This PR allows them to simply configure it inconfig.yaml:Changes
apisix/cli/ngx_tpl.lualua {}andstream {}blocksapisix/cli/config.luacustom_lua_shared_dictformetaandstreamapisix/cli/schema.luametaandstreamcustom_lua_shared_dictt/cli/test_custom_shared_dict.shBackward Compatibility
100% backward compatible. Default
custom_lua_shared_dictis an empty table — no behavior change without explicit configuration.Note: The
meta.custom_lua_shared_dictfeature only takes effect whenapisix-nginx-moduleis compiled in (i.e.,use_apisix_baseis true), since the globallua {}block itself is only rendered in that case.