Branch: refs/heads/master
Home: https://github.com/OpenSIPS/opensips
Commit: d3b1463ee115a8b7d4d6b9658c8b07b9ef3d0549
https://github.com/OpenSIPS/opensips/commit/d3b1463ee115a8b7d4d6b9658c8b07b9ef3d0549
Author: Liviu Chircu <[email protected]>
Date: 2022-11-04 (Fri, 04 Nov 2022)
Changed paths:
M modules/db_flatstore/flat_mi.c
M modules/db_flatstore/flat_mi.h
M modules/db_flatstore/flatstore.c
M modules/db_flatstore/flatstore_mod.c
Log Message:
-----------
db_flatstore: Fix missing CDRs due to 'flat_rotate' race conditions
This commit simply adds R/W locking around the 'flat_rotate' MI command,
and all the SIP worker processes. The race condition was as follows:
* SIP worker checks the 'flat_rotate' stamp and proceeds to write CDR
* 'flat_rotate' is ran (timestamp++)
* external process scans & fully reads the rotated file (with deletion
to follow later as well, but this is irrelevant)
* SIP worker finally writes the CDR using flushed/vector'ed I/O
(too late at this point, CDR is forever lost)
_______________________________________________
Devel mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel