Skip to content

Add shutdown hook function for lua plugin#13045

Open
shukitchan wants to merge 7 commits intoapache:masterfrom
shukitchan:luashutdown
Open

Add shutdown hook function for lua plugin#13045
shukitchan wants to merge 7 commits intoapache:masterfrom
shukitchan:luashutdown

Conversation

@shukitchan
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_down and wires it to TS_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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

shukitchan and others added 2 commits March 31, 2026 17:19
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@shukitchan shukitchan marked this pull request as ready for review April 1, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants