From abalashov@evaristesys.com Wed Feb 23 03:06:50 2022 From: Alex Balashov To: sr-users@lists.kamailio.org Subject: Re: [SR-Users] SQLOPS sql_query_async() not functioning in an async manner? Date: Tue, 22 Feb 2022 21:06:42 -0500 Message-ID: In-Reply-To: =?utf-8?q?=3CDM4PR11MB54070A853B5E41DB4FCE7F7BA43C9=40DM4PR11MB?= =?utf-8?q?5407=2Enamprd11=2Eprod=2Eoutlook=2Ecom=3E?= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2066884822==" --===============2066884822== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Is there a difference in how it behaves when: a) A database that was previously reachable becomes unreachable or unresponsi= ve? vs.=20 b) A db_url that is not reachable in principle? =E2=80=94 Alex > On Feb 22, 2022, at 7:11 PM, Ben Kaufman wrote: >=20 > I=E2=80=99m not sure if this is by design or not. I have things I want to = log to a SQL DB, but it=E2=80=99s not nearly as important as call handling, s= o the sql_query_async() function looked ideal, but in testing, if the DB is n= ot responsive, the call processing gets blocked. In the example below, I=E2= =80=99m using just a short hostname which isn=E2=80=99t resolvable, but if I = have an IP address there that isn=E2=80=99t really assigned (for example if t= he DB server is down), the same blocking behavior is exhibited, but the error= is slightly different (can=E2=80=99t connect instead of unknown host). =20 > =20 > =20 > =20 > Here=E2=80=99s my config. This specific simple config was tested on Kamail= io 5.5, but I observe similar behavior (in a more complicated config) in the = dev branch as well. > =20 > =20 > - - - -=20 > =20 > #!KAMAILIO > =20 > async_workers=3D2 > =20 > loadmodule "db_mysql" > loadmodule "sqlops" > loadmodule "sl" > loadmodule "xlog" > loadmodule "pv" > =20 > force_rport=3Dyes > =20 > ## Host sql does not resolve. > modparam("sqlops","sqlcon","cb=3D>mysql://kamailio:kamailiorw(a)sql/kamaili= o") > ## But start anyways. > modparam("sqlops", "connect_mode", 1) > =20 > request_route { > sl_send_reply("100", "Trying"); ## Prevent re-transmissions from the UAC > =20 > xlog("L_NOTICE", "Time before sql_query_async(): [$TV(Sn)]\n"); > sql_query_async("cb", "INSERT INTO table1 (col) VALUES ('val')"); > =20 > xlog("L_NOTICE", "Time before sl_send_reply(): [$TV(Sn)]\n"); > sl_send_reply("404", "Not found"); > } > =20 > =20 > Here=E2=80=99s the log if I send a simple INVITE with SIPp. Note the timest= amps > =20 > 9(16) NOTICE: