[OpenSIPS-Devel] [OpenSIPS/opensips] 8d6cd3: clusterer: Fix sync edge-case causing SHM accumula...

Liviu Chircu noreply at github.com
Thu Oct 24 16:04:39 UTC 2024


  Branch: refs/heads/3.4
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 8d6cd3740133b6dffee5ac236d136b0618a8c403
      https://github.com/OpenSIPS/opensips/commit/8d6cd3740133b6dffee5ac236d136b0618a8c403
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2024-10-24 (Thu, 24 Oct 2024)

  Changed paths:
    M modules/clusterer/sync.c

  Log Message:
  -----------
  clusterer: Fix sync edge-case causing SHM accumulation

This patch fixes a specific sync sequence leading to indefinite
accumulation of BIN packets and SHM exhaustion, as follows:

1) Sync Receiver node times out the sync in sync_check_timer()
    (default timeout is 5s, by no means difficult to achieve)
2) Sync Donor continues to send SYNC packets
    (on Receiver side, cap state is updated: PROGRESSING)
3) ! Sync Donor node loses link-state mid-sync, due to the pings being
    on the same TCP connection (and delayed, way in the back)
4) Sync Donor fails & drops remaining SYNC + SYNC-END packets, as link
    is down.  Due to this, the handle_sync_end(!is_timeout) procedure
    is never ran on the Receiver, so the PROGRESSING flag is never
    removed -> indefinite SHM buffering / memory leak

Thanks to Răzvan Crainea for helping with code & troubleshooting here!

(cherry picked from commit e5b2317ca9e9f33baef29205ecd792d8a5d5d2ed)


  Commit: d6ad7687b2ce1c6b14c99aa552e856837bdb86e3
      https://github.com/OpenSIPS/opensips/commit/d6ad7687b2ce1c6b14c99aa552e856837bdb86e3
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2024-10-24 (Thu, 24 Oct 2024)

  Changed paths:
    M modules/clusterer/sync.c

  Log Message:
  -----------
  clusterer sync: Fix several SHM leaks on error cases (Donor side)

(cherry picked from commit 101396a59c23f91bc821c36b9bc1bd2e5daa1d35)


Compare: https://github.com/OpenSIPS/opensips/compare/fe9fac9d7b21...d6ad7687b2ce

To unsubscribe from these emails, change your notification settings at https://github.com/OpenSIPS/opensips/settings/notifications



More information about the Devel mailing list