bryancall opened a new pull request, #14042:
URL: https://github.com/apache/trafficserver/pull/14042

   `traffic_ctl plugin msg` reaches `traffic_server` on the process manager 
thread, which delivers `TS_EVENT_LIFECYCLE_MSG` through `APIHook::invoke()`. 
That call only try-locks the hook's continuation mutex, and if the lock is held 
it calls `ink_release_assert(0)`. A plugin that uses one continuation for both 
its lifecycle message hook and its session or transaction hooks can therefore 
abort `traffic_server` when a message arrives while an event thread is in one 
of those hooks:
   
       Fatal: traffic_server/InkAPI.cc:1379: failed assertion `0`
         APIHook::invoke
         BaseManager::executeMgmtCallback
         ProcessManager::handleMgmtMsgFromLM
         ProcessManager::pollLMConnection
         ProcessManager::processManagerThread
   
   The `ssntxnorder_verify` test plugin is written this way. In 106 runs of the 
9.2.x branch Uranium job on 11/9 and 11/10, 
`test_continuation_open_close_order[h2]` failed 3 times (builds 912, 956 and 
968), each with `traffic_ctl metric get ssntxnorder_verify.test.done` timing 
out after 30 seconds. The CI console does not include `traffic.out`, but a 
loaded local run of the same test hit the abort above in 16 of 388 runs, with 
the same 30 second `traffic_ctl` timeout.
   
   The process manager thread gets its own `EThread` from `TSThreadInit()` and 
holds no other lock while it runs the management callbacks, so it can wait. 
This change uses `blocking_invoke()`, as the SSL secret hook already does. It 
is the 9.2.x counterpart of 
[#14007](https://github.com/apache/trafficserver/pull/14007), which makes the 
same change in the master JSONRPC handler.
   
   The new `msg_held_mutex` test plugin makes the overlap certain rather than 
likely. Its transaction hook holds the shared continuation's mutex until a 
second continuation, whose message hook runs first, sees a message, then keeps 
holding it for 5 seconds while the message reaches the shared continuation. 
Without the fix the new Uranium test fails 20 of 20 runs on the assertion 
above. With it, 20 of 20 pass, and each run logs the message waiting for the 
hold to end.


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