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

   A transaction that loses the cache write lock and schedules a retry
   hands HttpSM a reusable captive action owned by HttpCacheSM. When the
   retry fires, HttpSM::state_cache_open_write() assigns the result of
   adjust_thread() to pending_action before releasing that delivered
   action. The callback is normally already on the correct thread, so
   adjust_thread() returns nullptr, and assigning nullptr to a
   PendingAction cancels whatever it was holding. The transaction thereby
   cancels its own captive action, and the cache read that the retry
   immediately issues comes back on an action already marked cancelled.
   Debug builds abort on the resulting assertion in HttpCacheSM, which is
   how this was found in production; release builds instead take the
   cancelled early return, drop a valid cache callback, and stall the
   transaction until it times out.
   
   This patch clears the delivered action before the thread adjustment
   rather than after it. Clearing first is safe because the cache action
   has already called back, and it means a genuine reschedule installs its
   event as the new pending action instead of canceling a captive action
   that is still in use.
   
   This also adds an autest in which two transactions contend for the
   cache write lock with read-while-writer disabled, so the loser's write
   retry delivers a synchronous cache read callback. That test aborts
   reliably on an unpatched debug build.


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