Branch: refs/heads/4.0
Home: https://github.com/OpenSIPS/opensips
Commit: 482e5657bbd877bccbaa63922b80c2d271604c23
https://github.com/OpenSIPS/opensips/commit/482e5657bbd877bccbaa63922b80c2d271604c23
Author: Yury Kirsanov <[email protected]>
Date: 2026-10-08 (Thu, 08 Oct 2026)
Changed paths:
M lib/reg/common.h
Log Message:
-----------
registrar: randomize expiries inside the allowed band, not around it
randomize_expires() drew the random adjustment first and clamped the result
to min_expires/max_expires afterwards. Every draw that fell outside the
configured limits was therefore folded onto the limit itself rather than
spread, so contacts registering near a limit all received one identical
lifetime - the opposite of what expires_max_deviation is for, and a
synchronized cohort that re-registers in lockstep.
With min_expires 60 and expires_max_deviation 100, a 120 s registration put
20.6% of contacts on exactly 60 s; with min_expires 120 it was 50.4% on
exactly 120 s, and a contact registering at max_expires was affected the same
way at the top of the range.
Clamp the band before drawing from it instead. The resulting range is
unchanged, so no deployment receives a lifetime it could not have received
before, and registrations that are not near a limit are unaffected. Measured
over 200k draws, the worst single value falls from 20.6% to 0.7% at the
bottom of the range and from 50.2% to 1.1% at the top.
(cherry picked from commit e67c3e3576a2888f18d7704beedd48574e99de47)
To unsubscribe from these emails, change your notification settings at
https://github.com/OpenSIPS/opensips/settings/notifications
_______________________________________________
Devel mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel