[OpenSIPS/opensips] b9511b: dialog: Fix some locking corner-cases

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[OpenSIPS/opensips] b9511b: dialog: Fix some locking corner-cases

Vlad Pătrașcu
  Branch: refs/heads/3.0
  Home:   https://github.com/OpenSIPS/opensips
  Commit: b9511b91f1aea8b9f83da41cd18fd43ce6bc3092
      https://github.com/OpenSIPS/opensips/commit/b9511b91f1aea8b9f83da41cd18fd43ce6bc3092
  Author: Liviu Chircu <[hidden email]>
  Date:   2020-02-26 (Wed, 26 Feb 2020)

  Changed paths:
    M modules/dialog/dlg_db_handler.c
    M modules/dialog/dlg_handlers.c
    M modules/dialog/dlg_replication.c

  Log Message:
  -----------
  dialog: Fix some locking corner-cases

    * Re-INVITE pinging: synchronize writers and readers for the
       dlg->legs->adv_contact string, as well as the entire dlg->legs
       struct.  Example subtle race conditions:

         1. setting $DLG_timeout after t_relay() (read op) vs.
            concurrently processing a 200 OK (write op)

         2. calling MI "dlg_push_var" after t_relay() (read op) vs.
            concurrently processing a 200 OK (write op)

         3. in parallel forking, dlg_onreq_out() (read op) vs.
            concurrently processing 200 OK for prev. branch (write op)

    * DB load: to be 100% accurate, do not use ref_unsafe(), as we
       don't hold the lock -- use the safe version instead!

(cherry picked from commit 0dc968169a8d61cb6f9dea6143edb6dcf738e0d6)



_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel