No subject


Tue Nov 6 14:49:37 UTC 2007


loadmodule "dbtext.so"
modparam("dbtext", "db_mode", 1)

loadmodule "mi_fifo.so"
modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")

loadmodule "lcr.so"
modparam("lcr", "db_url", "dbtext:///usr/local/etc/openser/openser")
modparam("lcr", "fr_inv_timer_avp", "$avp(i:704)")
modparam("lcr", "gw_uri_avp", "$avp(i:709)")
modparam("lcr", "ruri_user_avp", "$avp(i:500)")
modparam("lcr", "contact_avp", "$avp(i:711)")
modparam("lcr", "rpid_avp", "$avp(i:302)")


Here's the content of the lcr table:
====================================
prefix(str) from_uri(str,null) grp_id(int) priority(int)
1:1:0:0
2:2:1:1
3:3:2:2


# openserctl lcr show
database engine 'DBTEXT' loaded
Control engine 'FIFO' loaded
lcr routes
1:1:0:0
2:2:1:1
3:3:2:2
lcr gateway groups
lcr gateways


# openserctl fifo lcr_dump
database engine 'DBTEXT' loaded
Control engine 'FIFO' loaded
entering fifo_cmd lcr_dump
RULE:: PREFIX=3 FROM_URI=3 GRP_ID=2 PRIORITY=2
RULE:: PREFIX=2 FROM_URI=2 GRP_ID=1 PRIORITY=1
RULE:: PREFIX=1 FROM_URI=1 GRP_ID=0 PRIORITY=0
FIFO command was:
:lcr_dump:openser_receiver_22687


at this point in time we add a new gateway:

# openserctl lcr addroute 4 4 3 3
database engine 'DBTEXT' loaded
Control engine 'FIFO' loaded


# openserctl lcr show
database engine 'DBTEXT' loaded
Control engine 'FIFO' loaded
lcr routes
1:1:0:0
2:2:1:1
3:3:2:2
4:4:3:3
lcr gateway groups
lcr gateways

# openserctl fifo lcr_dump
database engine 'DBTEXT' loaded
Control engine 'FIFO' loaded
entering fifo_cmd lcr_dump
RULE:: PREFIX=3 FROM_URI=3 GRP_ID=2 PRIORITY=2
RULE:: PREFIX=2 FROM_URI=2 GRP_ID=1 PRIORITY=1
RULE:: PREFIX=1 FROM_URI=1 GRP_ID=0 PRIORITY=0
FIFO command was:
:lcr_dump:openser_receiver_22772


now we will perform a reload:

# openserctl fifo lcr_reload
database engine 'DBTEXT' loaded
Control engine 'FIFO' loaded
entering fifo_cmd lcr_reload


... and the prompt never returns ...

And here's the debug output:
============================
Jul 12 15:00:40 oser openser[22624]: DEBUG:mi_fifo:mi_fifo_server: entered
consume
Jul 12 15:00:40 oser openser[22624]: DEBUG:mi_fifo:mi_fifo_server: ****
done consume
Jul 12 15:00:40 oser openser[22624]: DEBUG:mi_fifo:mi_fifo_server: done
parsing the mi tree
Jul 12 15:00:40 oser openser[22624]: DBT:dbt_cache_get_db: looking for db
/usr/local/etc/openser/openser!
Jul 12 15:00:40 oser openser[22624]: DBT:dbt_cache_get_db: db already
cached!
Jul 12 15:00:40 oser openser[22624]: DBT:dbt_cache_get_table: cache or
mtime succeeded
Jul 12 15:00:40 oser openser[22624]: DBT:dbt_query: new res with 7 cols
Jul 12 15:00:40 oser openser[22624]: DBT:dbt_result_new: new res with 7
cols


----------------------------------------------------------------------

>Comment By: Daniel-Constantin Mierla (miconda)
Date: 2007-11-09 17:33

Message:
Logged In: YES 
user_id=1246013
Originator: NO

Re-loading based on file mtime shall be fixed with the last commit.

----------------------------------------------------------------------

Comment By: Ovidiu Sas (osas)
Date: 2007-10-05 20:15

Message:
Logged In: YES 
user_id=1395524
Originator: YES

Here's the setup for reproducing this issue:

clean default install of openser (under /usr/local)

content of /usr/local/etc/openser/openserctlrc:
===============================================
DBENGINE=DBTEXT
DBTEXT_PATH="/usr/local/etc/openser/dbtext"
VERBOSE=1

content of /usr/local/etc/openser/openser.cfg:
==============================================
debug=9            # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=no    # (cmd line: -E)
children=1
disable_tcp=yes

# ------------------ module loading ----------------------------------
#set module path
mpath="/usr/local/lib/openser/modules/"

loadmodule "dbtext.so"
modparam("dbtext", "db_mode", 1)

loadmodule "mi_fifo.so"
modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")

loadmodule "lcr.so"
modparam("lcr", "db_url", "dbtext:///usr/local/etc/openser/dbtext")
modparam("lcr", "fr_inv_timer_avp", "$avp(i:704)")
modparam("lcr", "gw_uri_avp", "$avp(i:709)")
modparam("lcr", "ruri_user_avp", "$avp(i:500)")
modparam("lcr", "contact_avp", "$avp(i:711)")
modparam("lcr", "rpid_avp", "$avp(i:302)")
modparam("lcr", "dm_flag", 13)

# -------------------------  request routing logic -------------------
route{
        exit;
}


Perform the dbtext install: `openserdbctl create`
Start openser: `openserctl start`
Add a new gateway: `openserctl lcr addgw gw_1 1.1.1.1 5060 sip udp 1`
Peform a reload: `openserctl fifo lcr_reload`
Perform an interogation: `openserctl fifo lcr_dump`

Note: the table is not update ...

Peform a reload: `openserctl fifo lcr_reload`
Perform an interogation: `openserctl fifo lcr_dump`

Note: the table should be updated ...

Add a new gateway: `openserctl lcr addgw gw_2 1.1.1.2 5060 sip udp 1`
Peform a reload: `openserctl fifo lcr_reload`
Perform an interogation: `openserctl fifo lcr_dump`
Peform a reload: `openserctl fifo lcr_reload`
Perform an interogation: `openserctl fifo lcr_dump`
Peform a reload: `openserctl fifo lcr_reload`
Perform an interogation: `openserctl fifo lcr_dump`
....

And it should lock after a few reloads/interogations

----------------------------------------------------------------------

Comment By: Ovidiu Sas (osas)
Date: 2007-10-04 18:55

Message:
Logged In: YES 
user_id=1395524
Originator: YES

I managed to reproduce this again using the latest svn:
version: openser 1.3.0-dev21-notls (i386/linux)
flags: STATS: Off, USE_IPV6, USE_TCP, DISABLE_NAGLE, USE_MCAST, SHM_MEM,
SHM_MMAP, PKG_MALLOC, F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
svnrevision: 2:2853M
@(#) $Id: main.c 2736 2007-09-11 13:37:02Z bogdan_iancu $
main.c compiled on 10:47:57 Oct  4 2007 with gcc 4.1.2

Here's the backtrace:
(gdb) bt
#0  dbt_db_get_table (_dc=0x4040fe00, _s=0xbffff850) at
../../mem/../fastlock.h:162
#1  0x4001dfd5 in dbt_query (_h=0x8184fc8, _k=0x0, _op=0x0, _v=0x0,
_c=0xbffff950, _n=0, _nc=8, _o=0x0, _r=0xbffff984) at dbt_base.c:193
#2  0x4022e243 in reload_gws () at lcr_mod.c:782
#3  0x40235e27 in mi_lcr_reload (cmd_tree=0x0, param=0x0) at mi.c:41
#4  0x401f90d8 in mi_fifo_server (fifo_stream=0x8285480) at
../../mi/mi.h:84
#5  0x401fafb1 in fifo_process (rank=0) at mi_fifo.c:212
#6  0x080acd18 in start_module_procs () at sr_module.c:571
#7  0x0806aec6 in main (argc=3, argv=Cannot access memory at address 0x4
) at main.c:857

----------------------------------------------------------------------

Comment By: Ovidiu Sas (osas)
Date: 2007-07-17 21:15

Message:
Logged In: YES 
user_id=1395524
Originator: YES

after adding and removing several routes and gateways and running fifo
lcr_reload several times, the fifo lcr_dump displayed some updated tables,
but in the end it locked up:

Here are the debug logs:
 Jul 17 14:48:35 localhost /usr/local/sbin/openser[27818]:
DBT:dbt_cache_get_db: looking for db /usr/local/etc/openser/dbtext! 
Jul 17 14:48:35 localhost /usr/local/sbin/openser[27818]:
DBT:dbt_cache_get_db: db already cached! 

and here's the backtrace:
(gdb) bt
#0  0x40020c9e in tsl () from /usr/local/lib/openser/modules/dbtext.so
#1  0x4002167e in dbt_db_get_table () from
/usr/local/lib/openser/modules/dbtext.so
#2  0x4001e05d in dbt_query () from
/usr/local/lib/openser/modules/dbtext.so
#3  0x4020a581 in reload_gws () from
/usr/local/lib/openser/modules/lcr.so
#4  0x4020f493 in mi_lcr_reload () from
/usr/local/lib/openser/modules/lcr.so
#5  0x401ffcac in run_mi_cmd () from
/usr/local/lib/openser/modules/mi_fifo.so
#6  0x401ff78f in mi_fifo_server () from
/usr/local/lib/openser/modules/mi_fifo.so
#7  0x402004ef in mi_child_init () from
/usr/local/lib/openser/modules/mi_fifo.so
#8  0x0808c384 in init_mod_child ()
#9  0x0808c2d3 in init_mod_child ()
#10 0x0808c4a1 in init_child ()
#11 0x0806a26d in main_loop ()
#12 0x0806b88e in main ()

----------------------------------------------------------------------

Comment By: Ovidiu Sas (osas)
Date: 2007-07-17 19:20

Message:
Logged In: YES 
user_id=1395524
Originator: YES

The code doesn't lock anymore, but the lcr_reload is still not working.

started the server with the following lcr table:
# cat lcr 
prefix(str) from_uri(str,null) grp_id(int) priority(int) 
0:0:0:0
# openserctl fifo lcr_dump
RULE::  PREFIX=0 FROM_URI=0 GRP_ID=0 PRIORITY=0

after that, I have added a new route:
# openserctl lcr addroute 1 1 1 1
# openserctl lcr show
lcr routes
0:0:0:0
1:1:1:1
lcr gateway groups
lcr gateways


then performed a reload:
# openserctl fifo lcr_reload

The debug output:
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]:
DEBUG:mi_fifo:mi_fifo_server: entered consume 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]:
DEBUG:mi_fifo:mi_fifo_server: **** done consume 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]:
DEBUG:mi_fifo:mi_fifo_server: done parsing the mi tree 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]:
DBT:dbt_cache_get_db: looking for db /usr/local/etc/openser/dbtext! 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]:
DBT:dbt_cache_get_db: db already cached! 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]:
DBT:dbt_load_file: request for table [gw] 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]:
DBT:dbt_load_file: db is [/usr/local/etc/openser/dbtext] 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]:
DBT:dbt_load_file: loading file [/usr/local/etc/openser/dbtext/gw] 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]:
DBT:dbt_table_new: mtime is 1184596672 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]: DBT: column[0]
is STR! 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]: DBT: column[1]
is INT! 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]: DBT: column[2]
is STR! 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]: DBT: column[3]
is INT! 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]: DBT: column[4]
is INT! 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]: DBT: column[5]
is INT! 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]: DBT: column[6]
is INT! 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]: DBT: column[7]
is STR! 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]:
DTB:dbt_db_get_table: gw 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]: DBT:dbt_query:
new res with 7 cols 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]:
DBT:dbt_result_new: new res with 7 cols 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]:
DBT:dbt_check_mtime: [lcr] was updated 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]:
DBT:dbt_db_get_table: cache or mtime succeeded 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]: DBT:dbt_query:
new res with 4 cols 
Jul 17 12:52:26 localhost /usr/local/sbin/openser[27818]:
DBT:dbt_result_new: new res with 4 cols 

Interrogation via fifo:
# openserctl fifo lcr_dump
RULE::  PREFIX=0 FROM_URI=0 GRP_ID=0 PRIORITY=0

The second route is not showing up ....

----------------------------------------------------------------------

Comment By: Daniel-Constantin Mierla (miconda)
Date: 2007-07-17 11:59

Message:
Logged In: YES 
user_id=1246013
Originator: NO

I have just applied a fix. Please try again and let me know the result.
Thanks.

----------------------------------------------------------------------

Comment By: Ovidiu Sas (osas)
Date: 2007-07-16 16:35

Message:
Logged In: YES 
user_id=1395524
Originator: YES

After the latest pull from svn openser doesn't start properly.



More information about the Devel mailing list