Closed glitch59 closed 1 year ago
hmm, how many sources are connected? Are you using chroot ? Will check for any lock issues in that code path
karl
In this case there where 3 sources connected. Not using chroot.
XML code snippet:
<security>
<chroot>0</chroot>
<changeowner>
<user>icecast2</user>
<group>icecast</group>
</changeowner>
</security>
<mount type="normal">
<mount-name>/mount22.ogg</mount-name>
<stream-name>MyFancyName</stream-name>
<stream-url>http://endpoint.com/profile/mount22</stream-url>
<password>hackme</password>
<dump-file>/some/dir/dump.ogg</dump-file>
<authentication type="url">
<option name="allow_duplicate_users" value="0"/>
<option name="realm" value="MyRealmName"/>
<option name="mount_add" value="http://endpoint.com/mount/add/22"/>
<option name="mount_remove" value="http://endpoint.com/mount/remove/22"/>
<option name="listener_add" value="http://endpoint.com/listener/add/22"/>
<option name="listener_remove" value="http://endpoint.com/listener/remove/22"/>
</authentication>
</mount>
can you try a one-liner to see if the stalling point is where I think it is auth_url.c :178 to read
if (bytes <= 1 || client == NULL || client->respcode)
rebuild, retry. I suspect it is connecting but the 5 seconds is the overall request timeout.
karl
Just tested this locally and with auth_url.c :178 replaced as you suggested, the issue looks resolved.
Will test it in production tomorrow, when nobody is connected.
Thanks for the help! Sven
No more timeouts, but it does log the following error:
[2023-01-18 18:32:18] INFO main/server_process Shutting down
[2023-01-18 18:32:22] WARN auth_url/url_stream_end auth to server http://endpoint.com/mount/remove/1 (/mount1.ogg) failed with Operation timed out after 5001 milliseconds with 0 bytes received
[2023-01-18 18:32:22] INFO auth/auth_shutdown Auth shutdown complete
what does that script produce back to icecast, is there a body in the response etc. The reason I ask is that the timeout is actually from libcurl, 5 seconds being the overall timeout, connection timeout is 3 seconds and that change you did essentially returns very quickly any headers being passed. So something else is delaying the response somewhere.
karl
Thanks for pointing this out.
Turns out the mount_remove script makes a request to the Icecast server before processing the disconnect. But since the server is shutting down, it is very likely that there is no reaction. So that results in the timeout.
I will add some extra validations to the script to see if that solves the issue.
Improvements to the mount_remove script solved the timeout problem. This issue is resolved and can be closed. Thanks for the support! Sven.
Hi Karl,
Been testing the latest version and I have found another issue. Not critical, but it does needs some attention. Here we go:
Stopping Icecast takes long time and ends with killing the icecast process, when sources, that are connected during the shutdown, are using url_auth with the mount_remove section added.
The following data is logged in the error log, while stopping the server:
The endpoint.com URLs exist and are called when a mountpoint is removed (mount_remove). They are reachable and also function normally when called during normal operation. But when stopping the server, they apparently seem unreachable.
The server is stopped using:
root@server:/tmp# service icecast stop
Additional info:
Takes at least 90 seconds before server is killed as a result of a timeout.
Best regards, Sven