[sr-dev] [kamailio/kamailio] p_usrloc: new parameter "mdb_availability_control" has been created. (#1529)

Lucian Balaceanu notifications at github.com
Tue May 22 14:09:24 CEST 2018


lbalaceanu commented on this pull request.



> @@ -149,6 +152,25 @@ void check_dbs(unsigned int ticks, void *param){
 	lock_release(list_lock);
 }
 
+void check_master_db(int dbm_write_default) {
+	if(mdb_availability_control) {
+		if(mdb.write.dbh){

Is it necessary to close the connection each time when verifying it?

> @@ -677,6 +677,26 @@ modparam("usrloc", "db_update_as_insert", 1)
 ...
 modparam("p_usrloc", "default_db_url", "mysql://ser:ser@localhost/ser")
 ...
+</programlisting>

Since this is related to write_on_master_db, please move this documentation under the write_on_master_db parameter.

> @@ -102,13 +102,16 @@ int ul_db_child_init(void) {
 	if(ul_db_child_locnr_init() == -1) return -1;
 	
 	LM_INFO("location number is %d\n", max_loc_nr);
-	if(db_master_write){
+        lock_get(&write_on_master_db_shared->lock);

Check whether in ul_db_init() you need to acquire locks at all. It seems like this function is called one time only, before any fork is done, so most probably no synchronisation is needed. Same for lock release.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1529#pullrequestreview-122112955
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20180522/706cf859/attachment.html>


More information about the sr-dev mailing list