rlm_perl - unresponsive child threads

P. R.M. romero619 at hotmail.com
Sun Oct 18 23:21:52 CEST 2020


I'm trying to debug some issues when using rlm_perl with a mysql backend.

My module script uses the Perl DBI module in order to access the back-end, and I'm calling stored procedures for each of the radius sections (authorize, authenticate, accounting, etc.).

Some of the queries will occasionally take too long (~20-30sec+), and this will apparently cause the freeradius child threads to hang & die (correct?). When this happens, I'll find multiple sequences of entries in the radiusd log file such as the following:

Sat Oct 17 21:30:07 2020 : Error: Received conflicting packet from client 0.0.0.0/0 port 55526 - ID: 43 due to unfinished request in module perl.  Giving up on old request.
Sat Oct 17 21:30:12 2020 : Error: Received conflicting packet from client 0.0.0.0/0 port 55526 - ID: 43 due to unfinished request in module perl.  Giving up on old request.
Sat Oct 17 21:30:42 2020 : Error: Received conflicting packet from client 0.0.0.0/0 port 40463 - ID: 44 due to unfinished request in module perl.  Giving up on old request.
Sat Oct 17 21:30:47 2020 : Error: Received conflicting packet from client 0.0.0.0/0 port 40463 - ID: 44 due to unfinished request in module perl.  Giving up on old request.
Sat Oct 17 21:30:50 2020 : Error: Unresponsive child for request 2673, in component accounting module perl
Sat Oct 17 21:31:04 2020 : WARNING: (2674) WARNING: Module rlm_perl became unblocked
Sat Oct 17 21:31:04 2020 : WARNING: (2671) WARNING: Module rlm_perl became unblocked
Sat Oct 17 21:31:04 2020 : WARNING: (2672) WARNING: Module rlm_perl became unblocked
Sat Oct 17 21:31:04 2020 : WARNING: (2675) WARNING: Module rlm_perl became unblocked
Sat Oct 17 21:31:04 2020 : WARNING: (2673) WARNING: Module rlm_perl became unblocked

I'm already working on trying to improve the query speed, but there still might be inevitable occasional slow queries. So, I'm trying to figure out how to gain more insight on this problem and hopefully prevent it and/or handle it better.

So, my question(s):
1) what specifically causes the child thread to be detached/abandoned? is it a timeout issue within freeradius?
- In a normal Perl script that accesses a DB using DBI, a slow DB query will simply cause the script to wait indefinitely until the query finishes (unless a connection timeout occurs), but it wouldn't necessarily die/crash completely. This leads me to assume that there's some kind of hard-coded timeout within freeradius that expires & causes it to give up on the child thread if it's still stuck waiting for a query to finish. Is this correct or incorrect?

2) if there *is* some kind of built-in timeout within freeradius for processing sections via rlm_perl, what is its value? can it be changed/extended via some configuration setting? (I looked around a bit in the source code, but didn't see anything)

3) Aside from trying to guarantee that a query will never run slowly (not realistic in my case), is there anything else that can be done to handle a slow response from rlm_perl, instead of just giving up on the child thread? Some kind of debug logging for cases where the child thread(s) hang or don't respond in a timely fashion?


More information about the Freeradius-Users mailing list