Add shutdown hook function for lua plugin#13045
Open
shukitchan wants to merge 7 commits intoapache:masterfrom
Open
Add shutdown hook function for lua plugin#13045shukitchan wants to merge 7 commits intoapache:masterfrom
shukitchan wants to merge 7 commits intoapache:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Lua global plugin shutdown hook so Lua scripts can run cleanup logic when ATS exits, along with documentation and a gold test to validate the behavior.
Changes:
- Introduces a new Lua global callback
do_global_shut_downand wires it toTS_LIFECYCLE_SHUTDOWN_HOOK. - Adds a gold test + Lua script to verify the new shutdown hook is invoked.
- Documents the new Lua hook in the admin guide.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/gold_tests/pluginTest/lua/lua_global_shutdown.test.py | New gold test that exercises the Lua global shutdown hook via ATS shutdown. |
| tests/gold_tests/pluginTest/lua/global_shutdown.lua | New Lua script implementing the new global read + shutdown hooks for the test. |
| plugins/lua/ts_lua_common.h | Adds a constant for the new Lua global shutdown function name. |
| plugins/lua/ts_lua.cc | Registers a lifecycle shutdown hook and invokes the Lua shutdown function for each Lua state. |
| doc/admin-guide/plugins/lua.en.rst | Documents the new Lua shutdown hook and provides an example. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
No description provided.