2.2.0 & dhcp: regression

Eugene Grosbein fr at grosbein.net
Mon Jul 15 10:25:41 CEST 2013


On 12.07.2013 19:07, Alan DeKok wrote:

>   OK.  But I'm not aware of any change in any code which will limit the
> number of sockets.
> 
>> 2.1.12 has not this issue with same Perl.
> 
>   OK.  The rlm_perl module changed.  It added some locks to avoid issues
> with Perl Clone and threads.  Maybe you're running into lock contention.
> 
>   i.e. it worked in 2.1.12 by magic, because thread-specific structures
> were not locked properly.  Adding locks makes it *correct*, but at the
> price of performance.

I've realized that my perl code is not supposed to open distinct syslog
connection for each thread, as syslog() function is thread-safe per POSIX.

The code connects to syslog in CLONE_SKIP() in hope it should be called only once
per whole radiusd process life time. I've added more debug to CLONE_SKIP
and see it's called hundreds times in my case. I've modified my code
to call openlog() only once using private flag and solved my problem -
every thread uses creates only one file descriptor (persistent DB connection)
and I do not hit "the limit of 1024".

Basically, I solved our problem but one question persists:
why is CLONE_SKIP called many times at radiusd start time?

Eugene Grosbein



More information about the Freeradius-Users mailing list