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

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

  Branch: refs/heads/3.3
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 54243fe2a09fdd99b955db830241f289f06c0e1e
  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)

More information about the Devel mailing list