Hi!
First of all thanks for all of your work. I really
appreciate and I am glad that there is such a nice Opensource
SIP Proxy available.
In a current project I am heavily relying on SIP Traces
stored to a database and other sqlops, dialplan operations
using database connections.
It seems that there is a race condition with SQL Databases
(Postgres and also MySQL) due to thread insafety as described
in:
This is causing multiple errors. I guess that the following
error is also caused by this race condition (thread safety):
/usr/sbin/kamailio[5646]: ERROR: <core>
[db_query.c:179]: error while submitting query
/usr/sbin/kamailio[5646]: ERROR: siptrace
[siptrace.c:532]: error storing trace
/usr/sbin/kamailio[5646]: ERROR: db_mysql
[km_dbase.c:120]: driver error on query: Duplicate entry
'96193' for key 'PRIMARY'
My Kamailo Version (3.1.2) is reporting duplicate database
URLs using a warning:
/usr/sbin/kamailio[5613]: WARNING: <core>
[db_id.c:281]: identical DB URLs, but different DB
connection pid [5613/5562]
/usr/sbin/kamailio[5618]: WARNING: <core>
[db_id.c:281]: identical DB URLs, but different DB
connection pid [5618/5562]
/usr/sbin/kamailio[5616]: WARNING: <core>
[db_id.c:281]: identical DB URLs, but different DB
connection pid [5616/5562]
/usr/sbin/kamailio[5600]: WARNING: <core>
[db_id.c:281]: identical DB URLs, but different DB
connection pid [5600/5562]
/usr/sbin/kamailio[5617]: WARNING: <core>
[db_id.c:281]: identical DB URLs, but different DB
connection pid [5617/5562]
Git commit 9fb37a55e0b97a98b7d2d104a7692f18cb3f7df6 is
turning this into a debug message, which I think is a bad idea
if the thread insafety still exists.
As far as I know every thread should use its own database
handle, at least when using the MySQL API.
Is there a way to handle this correctly? Can you give me
any clues on which approach to take here? Since I need a
solution for this I would like to fix this issue at least for
myself and of course giving the change back.
Greetings Torge