signalwire / freeswitch

FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a versatile software implementation that runs on any commodity hardware. From a Raspberry PI to a multi-core server, FreeSWITCH can unlock the telecommunications potential of any device.
https://freeswitch.com/#getting-started
Other
3.54k stars 1.41k forks source link

Still Deadlocks when using MariaDB #2408

Open adamseeliger opened 6 months ago

adamseeliger commented 6 months ago

Issue 2063 is closed, but we still see Deadlocks using MariaDB.

FreeSWITCH Version 1.10.11 bitnami/mariadb-galera:11.2.2

mod_mariadb.c:274 Could not commit transaction: Deadlock found when trying to get lock; try restarting transaction

There are no other erros / exceptions in the freeswitch / mariadb logs.

We use mod_xml_curl for registrations and mod_sofia for client connections.

wangcc57 commented 4 months ago

"update sip_registrations set ping_expires" of internal and external will trigger this deadlock, sometime the X lock of mysql will lock,so you can add a mutex in Sofia, before you update this table, lock the mutex, and after unlock.

sofia_reg.c method sofia_reg_check_ping_expire