From 57a827702e259fbccbe00a88d9d013f8318c771c Mon Sep 17 00:00:00 2001 From: Rene Krenn Date: Tue, 2 Sep 2025 11:48:00 +0200 Subject: [PATCH] MT#63500 skip cdr if failing to acquire contract lock to avoid rateomat exiting, we now skip a CDR if it fails to acquire all involved contract row locks rather than bailing out. Change-Id: Ibbe3b4e0c40008aa033673a7ef3fa98d54945417 (cherry picked from commit 840ccb33f5718b639de2d1d21bf9a634f39e9eef) --- rate-o-mat.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rate-o-mat.pl b/rate-o-mat.pl index 08efa95..3896562 100755 --- a/rate-o-mat.pl +++ b/rate-o-mat.pl @@ -3721,7 +3721,13 @@ sub main { # the whole transaction. thus locking contract rows for preventing # concurrent catchups will be our very first SQL statement in the # billingdb transaction: - lock_contracts($cdr); + eval { lock_contracts($cdr); }; + if ($@) { + commit_transaction($acctdbh); + commit_transaction($billdbh); + check_shutdown() and last BATCH; + next CDR; + } begin_transaction($provdbh); begin_transaction($dupdbh);