[OpenSIPS-Devel] [OpenSIPS/opensips] da6e20: sql_cacher: fix reload version initialization race

Liviu Chircu noreply at github.com
Mon Sep 21 10:46:19 UTC 2026


  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: da6e20e729f2a8613364deda9baca665d2296ef8
      https://github.com/OpenSIPS/opensips/commit/da6e20e729f2a8613364deda9baca665d2296ef8
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2026-09-21 (Mon, 21 Sep 2026)

  Changed paths:
    M modules/sql_cacher/sql_cacher.c

  Log Message:
  -----------
  sql_cacher: fix reload version initialization race

Replace the non-atomic add(+1)/sub(-1) initialization with add(0), which
atomically creates the reload-version counter without changing an
existing value.  This avoids failures when an MI reload increments the
counter during startup.

Consolidate counter initialization and increments into a single helper.
During full-table startup loads, fetch the current version under the
entry write lock and store it with the loaded rows, preventing
concurrent reloads from making the startup data immediately stale.

Also continue initializing later cache entries when one cache fails.

Co-authored-by: Bence Szigeti <bence.szigeti at gohyda.com>



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



More information about the Devel mailing list