jketterl / codecserver

Modular audio codec server
GNU General Public License v3.0
15 stars 5 forks source link

Docker container causing 100% CPU core load with default config when IPv6 not available #10

Open jgroman opened 2 years ago

jgroman commented 2 years ago

I tried running openwebrx and later just codecsesrver latest Docker image on my x86_64 box running Ubuntu server 20.04. Codecserver running in both those containers would cause 100% CPU core load and following console output:

# docker run -v codecserver-config:/etc/codecserver -p 1073:1073 jketterl/codecserver:latest
Hello, I'm the codecserver.
now scanning for modules...
registering new driver: "ambe3k"
loading devices from configuration...
auto-detecing devices...
scanning for "ambe3k" devices...
device scan complete.
socket error: Address family not supported by protocol

After looking info configuration I found out that the issue is probably related to unavailability of IPv6. My server has IPv6 disabled in GRUB configuration /etc/default/grub like this:

GRUB_CMDLINE_LINUX="ipv6.disable=1"
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"

After modifying codecserver server type to tcp4 everything worked as expected. May I suggest for codecserver to have some kind of tcp6 to tcp4 fallback in case tcp6 is not available and server type is set to tcp?

Thank you!

jketterl commented 2 years ago

The tcp server type already provides fallback for IPv4 connections if an IPv6 stack is available, so it's basically dual stack. I have not had the time to experiment with an automatic fallback for an IPv4-only scenario, the tcp4 server is basically the manual fallback for that case for now.

It would probably be a good idea to have just one tcp server type in the future if it works out.

jketterl commented 1 year ago

I ended up not merging the provided PR simply because it contained a number of unrelated changes. I did try to fix the underlying issue in the latest commits though. Please let me know if this is fixed now.