bneradt commented on code in PR #13556:
URL: https://github.com/apache/trafficserver/pull/13556#discussion_r4051148374


##########
tests/gold_tests/pluginTest/lua/lua_global_shutdown.test.py:
##########
@@ -25,40 +28,172 @@
 
 Test.ContinueOnFail = True
 
+# Helper script for signaling a traffic_server process by command-line 
identifier
+# match. Reused from gold_tests/logging.
+TS_PID_SCRIPT = 'ts_process_handler.py'
+
 server = Test.MakeOriginServer("server")
-ts = Test.MakeATSProcess("ts")
+
+# The identifier shutdown_race_client.py matches on to find this process.
+ts = Test.MakeATSProcess("lua_shutdown_ts")

Review Comment:
   Fixed in faa4712b95: the comment now explicitly identifies lua_shutdown_ts 
as the identifier matched by shutdown_race_client.py. Formatting passed, and 
the Python AST is unchanged.



##########
doc/admin-guide/plugins/lua.en.rst:
##########
@@ -137,6 +137,27 @@ Example::
         ts.debug('ATS shutting down, cleaning up resources')
     end
 
+Because ``__shutdown__`` commonly releases process global resources, no Lua 
code
+runs in any of the plugin's Lua states while the ``__shutdown__`` functions are
+invoked: the plugin waits for every state to become idle first, and no Lua
+callback enters a state after that. If a state is still executing Lua after 
five
+seconds, the ``__shutdown__`` functions are skipped rather than run 
concurrently
+with it, and that is reported in the error log. Requests are held for as long 
as a
+``__shutdown__`` function runs, so it should return promptly.

Review Comment:
   Fixed in faa4712b95: the documentation now states that all state mutexes are 
retained until process exit and that requests waiting to enter those states 
remain blocked even after the shutdown functions return. The documentation 
build passed with Sphinx warnings treated as errors.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to