After some recent changes to my rlm_perl perl script I am getting the following messages all the time... Tue Aug 8 08:08:50 2006 : Error: WARNING: Unresponsive child (id 2966633392) for request 28 Tue Aug 8 08:08:50 2006 : Error: WARNING: Unresponsive child (id 2977528752) for request 27 Tue Aug 8 08:08:50 2006 : Error: WARNING: Unresponsive child (id 2988153776) for request 25 Usually after a lot of these radius will crash and will need to be restarted. I was receiving the sql running out of connections error but I am not getting those anymore after tuning my tables. I don't believe at this point that this is a mysql issue however any suggestions would be appreciated. I do access mysql from my perl script so that could be the problem. Each function in the perl script opens a mysql connection then closes it before finishing the function. Could this be the problem? Should I create an initial connection and use it throughout the script? Thanks Guys, I know you will know what the problem is.
Matt Dunkin <mdunkin@innflux.com> wrote:
After some recent changes to my rlm_perl perl script I am getting the following messages all the time...
Tue Aug 8 08:08:50 2006 : Error: WARNING: Unresponsive child (id 2966633392) for request 28
Something's blocking the thread.
Each function in the perl script opens a mysql connection then closes it before finishing the function. Could this be the problem? Should I create an initial connection and use it throughout the script?
Yes. That would probably help a lot. The "unresponsive child" message comes out after about 20 seconds of problems, which is a pretty serious problem. Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog
I tried opening a mysql connection outside the functions in my perl script then using that handle through out the perl script. I am getting the following error... Error: rlm_perl: perl_embed:: module = /usr/local/etc/raddb/modules/billing.pl , func = accounting exit status= DBD::mysql::db prepare failed: handle 2 is owned by thread 9b19fc8 not current thread 9cfdac8 (handles can't be shared between threads and your driver may need a CLONE method added) at /usr/local/etc/raddb/modules/billing.pl line 214. Alan DeKok wrote:
Matt Dunkin <mdunkin@innflux.com> wrote:
After some recent changes to my rlm_perl perl script I am getting the following messages all the time...
Tue Aug 8 08:08:50 2006 : Error: WARNING: Unresponsive child (id 2966633392) for request 28
Something's blocking the thread.
Each function in the perl script opens a mysql connection then closes it before finishing the function. Could this be the problem? Should I create an initial connection and use it throughout the script?
Yes. That would probably help a lot.
The "unresponsive child" message comes out after about 20 seconds of problems, which is a pretty serious problem.
Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Hi Use sub CLONE to create for each thread separate SQL connection. for more information see rlm_perl on wiki.freeradius.org On Tuesday 08 August 2006 19:34, Matt Dunkin wrote:
I tried opening a mysql connection outside the functions in my perl script then using that handle through out the perl script. I am getting the following error...
Error: rlm_perl: perl_embed:: module = /usr/local/etc/raddb/modules/billing.pl , func = accounting exit status= DBD::mysql::db prepare failed: handle 2 is owned by thread 9b19fc8 not current thread 9cfdac8 (handles can't be shared between threads and your driver may need a CLONE method added) at /usr/local/etc/raddb/modules/billing.pl line 214.
Alan DeKok wrote:
Matt Dunkin <mdunkin@innflux.com> wrote:
After some recent changes to my rlm_perl perl script I am getting the following messages all the time...
Tue Aug 8 08:08:50 2006 : Error: WARNING: Unresponsive child (id 2966633392) for request 28
Something's blocking the thread.
Each function in the perl script opens a mysql connection then closes it before finishing the function. Could this be the problem? Should I create an initial connection and use it throughout the script?
Yes. That would probably help a lot.
The "unresponsive child" message comes out after about 20 seconds of problems, which is a pretty serious problem.
Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Best Regards, Boian Jordanov SNE Orbitel - Next Generation Telecom tel. +359 2 4004 723 tel. +359 2 4004 002
I do exactly the same thing as you - I get this problem from time to time (usually accompanied by a few discarding duplicate request messages as the nas re attempts). The documentation says that if you get these its probably back end, and its right. Usually its a slow query of some description, or the SQL server fails to respond in a timely manner. Do you account to SQL as well?. You could log slow queries in SQL and examine these. Of course it could be a loop thats not exiting within your perl script or something. Heres a list of things that have caused it for me. 1) Could not connect to accounting database in a timely manner (fixed this by putting a connect timeout and dropping the packet if no connection can be made) 2) Queries were taking too long (added a couple of keys/indexes) 3) Disk filled up on accounting database (SQL just sat there and didn't respond!) Its always been my fault, never radius's. My suggestion, put some more error checking in your script and if it cant do anything due to back end return RLM_MODULE_FAIL (one of the constants in the example).
Each function in the perl script opens a mysql connection then closes it before finishing the function. Could this be the problem? Should I create an initial connection and use it throughout the script?
I find the simplest thing to do is create a persistent DBH, and create a routine which checks the DBH handle at the beggining of my script like so ($dbh is a global): sub ensuredbh{ #if the database connection raised an error at the last query or if there isnt a database handle, then re-create one. if(ref($dbh) && $dbh->ping) { return 1; } else{ print "Database connection error - re-establishing\n"; our $dbh=DBI->connect($dbhdsn,$dbhuser,$dbhpass) or return 0);} return(1); } } in authenticate i can do &ensuredbh or return RLM_MODULE_FAIL;
After some recent changes to my rlm_perl perl script I am getting the following messages all the time...
Tue Aug 8 08:08:50 2006 : Error: WARNING: Unresponsive child (id 2966633392) for request 28 Tue Aug 8 08:08:50 2006 : Error: WARNING: Unresponsive child (id 2977528752) for request 27 Tue Aug 8 08:08:50 2006 : Error: WARNING: Unresponsive child (id 2988153776) for request 25
Usually after a lot of these radius will crash and will need to be restarted. I was receiving the sql running out of connections error but I am not getting those anymore after tuning my tables. I don't believe at this point that this is a mysql issue however any suggestions would be appreciated. I do access mysql from my perl script so that could be the problem.
Each function in the perl script opens a mysql connection then closes it before finishing the function. Could this be the problem? Should I create an initial connection and use it throughout the script?
Thanks Guys, I know you will know what the problem is.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Thanks for the suggestions guys... for now I think I have located the problem. I had the max servers set at 32. I bumped that number up to 64 and also cleaned up my perl script a little. Alan Lumb wrote:
I do exactly the same thing as you - I get this problem from time to time (usually accompanied by a few discarding duplicate request messages as the nas re attempts).
The documentation says that if you get these its probably back end, and its right. Usually its a slow query of some description, or the SQL server fails to respond in a timely manner. Do you account to SQL as well?. You could log slow queries in SQL and examine these.
Of course it could be a loop thats not exiting within your perl script or something.
Heres a list of things that have caused it for me. 1) Could not connect to accounting database in a timely manner (fixed this by putting a connect timeout and dropping the packet if no connection can be made) 2) Queries were taking too long (added a couple of keys/indexes) 3) Disk filled up on accounting database (SQL just sat there and didn't respond!)
Its always been my fault, never radius's. My suggestion, put some more error checking in your script and if it cant do anything due to back end return RLM_MODULE_FAIL (one of the constants in the example).
Each function in the perl script opens a mysql connection then closes it before finishing the function. Could this be the problem? Should I create an initial connection and use it throughout the script?
I find the simplest thing to do is create a persistent DBH, and create a routine which checks the DBH handle at the beggining of my script like so ($dbh is a global):
sub ensuredbh{ #if the database connection raised an error at the last query or if there isnt a database handle, then re-create one. if(ref($dbh) && $dbh->ping) { return 1; } else{ print "Database connection error - re-establishing\n"; our $dbh=DBI->connect($dbhdsn,$dbhuser,$dbhpass) or return 0);} return(1); } }
in authenticate i can do &ensuredbh or return RLM_MODULE_FAIL;
After some recent changes to my rlm_perl perl script I am getting the following messages all the time...
Tue Aug 8 08:08:50 2006 : Error: WARNING: Unresponsive child (id 2966633392) for request 28 Tue Aug 8 08:08:50 2006 : Error: WARNING: Unresponsive child (id 2977528752) for request 27 Tue Aug 8 08:08:50 2006 : Error: WARNING: Unresponsive child (id 2988153776) for request 25
Usually after a lot of these radius will crash and will need to be restarted. I was receiving the sql running out of connections error but I am not getting those anymore after tuning my tables. I don't believe at this point that this is a mysql issue however any suggestions would be appreciated. I do access mysql from my perl script so that could be the problem.
Each function in the perl script opens a mysql connection then closes it before finishing the function. Could this be the problem? Should I create an initial connection and use it throughout the script?
Thanks Guys, I know you will know what the problem is.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (4)
-
Alan DeKok -
Alan Lumb -
Boian Jordanov -
Matt Dunkin