[asterisk-dev] cdr_radius.c thread safety
Alex Massover
alex at jajah.com
Fri Feb 26 15:43:25 CST 2010
Hi,
Here's an official answer from FreeRADIUS project leader that having static rc_handle is not thread-safe.
https://lists.freeradius.org/pipermail/freeradius-devel/2010-February/013726.html
I did the same design for my custom module and experience troubles. Fortunately changing it to rc_handle per thread is not complex.
I'll make sure that it works for my module and will send a patch for cdr_radius.c too.
-----Original Message-----
From: asterisk-dev-bounces at lists.digium.com [mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of Tilghman Lesher
Sent: יום ב 01 פברואר 2010 03:13
To: Asterisk Developers Mailing List
Subject: Re: [asterisk-dev] cdr_radius.c thread safety
On Sunday 31 January 2010 05:39:30 Alex Massover wrote:
> I'm trying to understand if there's thread safety problem with cdr_radius
> module. I'm pretty new to Asterisk internals, so please correct me if I
> misunderstand something.
>
> AFAIU, cdr_radius.c load_module() called once upon loading the module, and
> it exports radius_log() function. Each call opens a thread, so radius_log()
> can be called from different threads and should be thread-safe.
>
> But the radiusclient-ng lib, the module uses, is neither thread-safe nor
> reentrant.
>
> Is it a potential problem or I just miss something?
It might be a potential problem, if the function that calls the backend
function did not serialize all requests. However, I'm curious as to what
resource you've cited as to the thread-safety of the library, as the history
of the FreeRADIUS library tends to suggest the opposite: that radiusclient-ng
is not only threadsafe, but also reentrant.
See http://wiki.freeradius.org/Radiusclient#History
--
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
This mail was received via Mail-SeCure System.
This mail was sent via Mail-SeCure System.
More information about the asterisk-dev
mailing list