vforteli/Flexinets.Radius.RadiusClient

100% CPU usage on RHEL7

sishik1 opened this issue · 3 comments

It appears when RadiusClient is instantiated and then properly disposed (even without sending anything), the CPU on the RHEL7 box jumps to 100%. I have ASP .NET Core 3.1 application where I'm using the RadiusClient and I'm seeing the dotnet service jumping to 100% as soon as the program starts using RadiusClient. The only way to drop the CPU usage is to kill the process.

The only suspicious part that I'm seeing is the StartReceiverLoopAsync() in the RadiusClient. Could that be the source of 100% usage?

Also, it appears the fix is pretty simple. Inside StartReceiveLoopAsync() method, there is catch (ObjectDisposedException). I think it's missing return; to exit the loop.

Hi,

Could be, I have only run it on windows, and at least there the missing return doesnt make any difference, since the udpclient is already disposed, and the reason it throws an exception there is because the thread is being terminated. I do agree it would look better with a return there though.
I also dont know how ASP.Net Core will handle those threads, never tried running it from other than console and wpf applications.
Ill see if I can replicate it

Sounds good. Will look forward to your updated component.