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

   * Fix an error on SSL config reload (plus some cleanup).
   
   This seems to have eliminated some ERROR diags we were seeing in Yahoo Prod 
when doing config reloads.
   
   The SSLSecret public functions no longer return pointers into the 
unorded_map of secrets, they return a copy of the secret data. This seemed 
thread unsafe. A periodic poll running in the background can update the secret 
data for an entry for a secret name in the map.
   
   To avoid exporting pointers, I had to change the prototype of 
TSSslSecretGet(). Hopefully there are no existing plugins that are already 
using this TS API function, so breaking this rule will be moot.
   
   * YTSATS-4067: Fix deadlock with secret_map_mutex (#740)
   
   1. getOrLoadSecret grabbed the secret_map_mutex and called loadSecret.
   2. loadSecret dispatched to Continations that registered for the 
TS_EVENT_SSL_SECRET event. This would try to grab the Continuation's lock.
   3. In the meantime, those Continuations could call setSecret which would try 
to grab the secret_map_mutex. If this Continuation did this while holding the 
lock that step 2 is waiting upon, then there will be a deadlock between the 
Continuation lock and the secret_map_mutex between the two threads.
   
   This patch avoids the deadlock by releasing the secret_map_mutex lock before 
calling loadSecret. It also updates the secret_map when loading secrets from a 
file in loadSecret.
   
   ---------
   
   Co-authored-by: Brian Neradt <[email protected]>
   (cherry picked from commit 0c2488c7d0432698272b1433817ee62d0c263ab4)
   
   Conflicts:
   src/traffic_server/InkAPI.cc


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