<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.E-MailFormatvorlage18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.E-MailFormatvorlage19
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE-AT link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Contract locking apraoch was not changed actually.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Basically this can happen only if the contracts of a cdr are retrieved via panel/api while rate-o-mat tries to rate the cdr, and the panel/api request take longer time.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Do you have scripts that poll subscriber or contract collections? What times of day did the errors occur?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Eg. the credit warning job script also uses api to retrive data and was fixed to iterate the full collection, so it has longer processing times and could be causing this.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Rate-o-mat retries up to 3 times (by default). So an option for now is to increase the retry count, decrease the rate-o-mat cdr batch size or increase the mysql lock timeout.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>We are currently working on refactoring the fraud and credit warning jobs.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>br<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=DE style='mso-fareast-language:DE-AT'>Von:</span></b><span lang=DE style='mso-fareast-language:DE-AT'> Spce-user [mailto:spce-user-bounces@lists.sipwise.com] <b>Im Auftrag von </b>Hohl Matthias<br><b>Gesendet:</b> Freitag, 19. Juli 2019 23:51<br><b>An:</b> spce-user@lists.sipwise.com<br><b>Betreff:</b> [Spce-user] rate-o-mat FATAL error lock wait timeout exceede<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hello,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US>since update to 6.5.5 few months ago I regonized that rate-o-mat fails every few days.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>This is the log entry:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:DE-AT'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:DE-AT'>root@spce:~# grep FATAL /var/log/ngcp/rate-o-mat.log<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:DE-AT'>Jul 19 23:12:50 spce (info) rate-o-mat[10861]: FATAL: FATAL: Error executing contract row lock statement: Lock wait timeout exceeded; try restarting transaction<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>After a rate-o-mat restart everything works fine  for few days but then same happens again.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Is there a fix for this “new” error?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Thank you.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Matthias<o:p></o:p></span></p></div></body></html>