[OpenSIPS-Devel] [OpenSIPS/opensips] 4884d6: Fix race condition on terminating child procs.

Bogdan-Andrei Iancu bogdan at opensips.org
Wed Apr 15 11:27:12 CEST 2015


  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 4884d6c921695c588b8076ded186665504550773
      https://github.com/OpenSIPS/opensips/commit/4884d6c921695c588b8076ded186665504550773
  Author: Bogdan-Andrei Iancu <bogdan at opensips.org>
  Date:   2015-04-15 (Wed, 15 Apr 2015)

  Changed paths:
    M main.c
    M pt.c

  Log Message:
  -----------
  Fix race condition on terminating child procs.

There is a race condition between a child getting initalized (and properly setting all its vars like is_main, pid, etc) and main process trying to terminate that child proc (due a failed startup).
Use the pt[].pid as a marker to know when the child is init (to be filled only by child). Main proc (when delivering signals) will do a busy waiting if a proc haven't set its pid (still doing init).

Closes #463




More information about the Devel mailing list