[OpenSIPS-Devel] [OpenSIPS/opensips] aaba23: Fix race in TCP Main <> TCP Worker communication

Bogdan Andrei IANCU noreply at github.com
Fri Mar 10 12:12:58 UTC 2023

  Branch: refs/heads/3.1
  Home:   https://github.com/OpenSIPS/opensips
  Commit: aaba2357196f35ecd206becc3364b04d2f2f4fdb
  Author: Bogdan-Andrei Iancu <bogdan at opensips.org>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M net/net_tcp.c
    M net/net_tcp_proc.c
    M net/tcp_conn.h

  Log Message:
  Fix race in TCP Main <> TCP Worker communication

As a TCP worker has 2 comm channels (one TCP worker specific and one worker generic) to TCP Main, be sure we have a consistent communication (over the 2 channels) between the TCP worker and TCP main.
The actual fixed race: the TCP workers creates a new TCP conn (and sends this event as TCP worker to Main) and when trying to write to the conn it fails (and sends back a bad-conn event to Main, but as generic worker) - the 2 events are delivered via different comm channels, so their order may be lost, reasulting to bogus behavior

(cherry picked from commit bfb62212ea4b4895b3174653b11d33e7ecb92751)
(cherry picked from commit b1f580e4184562ce943ce428660becd1e48238b8)

More information about the Devel mailing list