c-taylor opened a new issue #7372:
URL: https://github.com/apache/trafficserver/issues/7372


   ATS version 8.1.x
   
   I was able to consistently cause server restarts when using the ts.sleep 
function as per examples in the admin guide.
   
   ### Configuration
   ```
   map http://property1.mycdn.com/    http://origin1.mycdn.com:8080/  
@plugin=tslua.so @pparam=sleep-request.lua
   remap.config:map https://property1.mycdn.com/    
http://origin1.mycdn.com:8080/  @plugin=tslua.so @pparam=sleep-request.lua
   ```
   
   sleep-request.lua:
   ```
       function send_response()
           ts.sleep(3)
       end
       function read_response()
           ts.sleep(3)
       end
       function do_remap()
           ts.hook(TS_LUA_HOOK_READ_RESPONSE_HDR, read_response)
           ts.hook(TS_LUA_HOOK_SEND_RESPONSE_HDR, send_response)
       end
   ```
   
   Hooks that crash:
   “TS_LUA_HOOK_(SEND|READ)_RESPONSE_HDR”
   “TS_LUA_HOOK _CACHE_LOOKUP_COMPLETE”
   “TS_LUA_HOOK_SEND_REQUEST_HDR”
   
   Hooks that don't crash:
   “TS_LUA_RESPONSE_TRANSFORM”
   “TS_LUA_HOOK_TXN_CLOSE”
   “TS_LUA_HOOK _OS_DNS”
   
   Sleep only really performed as expected for "TS_LUA_HOOK _OS_DNS” in my case.
   There is also an. example in 'plugins/lua/example/test_sleep.lua', 
derivations of which have the same results.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to