lossless1024 / StreaMonitor

Adult live stream downloader for advanced people. I could have chosen a better name.
GNU General Public License v3.0
198 stars 52 forks source link

zmq.error.ZMQError: Address already in use (after quitting) #41

Closed nolageek closed 1 year ago

nolageek commented 1 year ago

Many times when I quit out of StreaMonitor (CntrlC or using Quit) I can't restart it without getting the error:

zmq.error.ZMQError: Address already in use.

DerBunteBall commented 1 year ago

That indicates that the resources doesn't be made free.

Which platform do you use and when you quit does all processes stop or are there still open process (main as well as childs)?

I could imagine that aspecially on Windows this could happen because there is no clean shutdown procedure for Windows actually.

Best Regards

nolageek commented 1 year ago

I'm on AlmaLinux. This usually happens when it's reached the 5% disk space trigger and everything is showing as stopped. Since I dont want to run Start * (because I'm not sure if that's going to start the individual monitors I've manually stopped) I usually just Quit or ^C - but then I can't restart because of the error.

DerBunteBall commented 1 year ago

As a frist step after doing this check if the process really closes (use ps or top).

In fact the code doesn't close the ZeroMQ socket explicitly. Eventually also the process doesn't stop really. If it stops really it's a question how the operating system handles sockets which were opened by stopped processes. Here the OSes, Kernel Versions, and System Managment Stuff (systemd, sys-v init etc.) can behave different.

At the end the socket is still open.

When the process really stops I think we should close the ZeroMQ socket explicitly in the code.

lossless1024 commented 1 year ago

Added a fix that might solve this. Reopen if not.