Open brenc opened 2 years ago
By the way, I was experimenting with HLS and noticed that this does NOT happen when I comment out the icecast outputs. If I switch my output to this:
let ngr.outputs.aac_lofi = %ffmpeg(
format="mp4",
movflags="+dash+skip_sidx+skip_trailer+frag_custom",
frag_duration=10,
%audio(
codec="aac",
channels=2,
ar=44100,
b="32k",
)
)
let ngr.outputs.aac_midfi = %ffmpeg(
format="mp4",
movflags="+dash+skip_sidx+skip_trailer+frag_custom",
frag_duration=10,
%audio(
codec="aac",
channels=2,
ar=44100,
b="64k",
)
)
let ngr.outputs.aac_hifi = %ffmpeg(
format="mp4",
movflags="+dash+skip_sidx+skip_trailer+frag_custom",
frag_duration=10,
%audio(
codec="aac",
channels=2,
ar=44100,
b="128k",
)
)
def ngr.outputs.hls_segment_name(~position, ~extname, stream_name)
timestamp = int_of_float(time())
duration = 2
"#{stream_name}_#{duration}_#{timestamp}_#{position}.#{extname}"
end
output.file.hls(
persist_at="state.config",
playlist="radio.m3u8",
segments=5,
segment_duration=2.0,
segments_overhead=5,
segment_name=ngr.outputs.hls_segment_name,
"/ngradio/hls/aac",
[
("aac_lofi", ngr.outputs.aac_lofi),
("aac_midfi", ngr.outputs.aac_midfi),
("aac_hifi", ngr.outputs.aac_hifi),
],
ngr.radio
)
Then connect harbor.input and restart (via sending SIGTERM), ls fully shuts down and restarts cleanly.
Thanks for reporting. Could you try with this build once it finishes: https://github.com/savonet/liquidsoap/actions/runs/3094064733 ? The issue could be fixed with it.
Sure thing. Will this ever end up on Docker Hub?
Yeah there were a bunch of different things that hit the CI but it's coming up right now: https://github.com/savonet/liquidsoap/actions/runs/3100710130
Just tried savonet/liquidsoap:rolling-release-v2.1.x
and the issue is still there.
Ha damn. Do you have any log of the issue with the latest rolling-release-v2.1.x
?
Just tried it again with rolling-release-v2.1.x
and it looks like #2584 is back, so I couldn't really test this (buffer empties, input keeps getting disconnected).
Something hit me while I was on a walk recently: I don't think I actually tried the latest rolling release. I don't often use images tagged like this so I totally forgot that you have to manually pull to get the latest image. This is probably why #2584 was still there.
I just pulled the latest rolling-release-v2.1.x
and #2584 was definitely not there, but ls still crashes when harbor is connected and never fully shuts down.
Thanks for testing! I'm gonna have another pass at this one!
Describe the bug In development, I have ls starting up under nodemon which will send a SIGTERM when it detects a config change in order to restart it:
CMD ["nodemon", "-e", "liq,cert,key", "--signal", "SIGTERM", "--exec", "/usr/bin/liquidsoap", "--", "/app/test.liq"]
Normally this will cause ls to restart without issue. However, I've noticed that when input.harbor is connected (SSL or not) ls will crash with something like this:
The old process never fully shuts down. The new process tries to start, but crashes with:
Error while trying to bind server/telnet socket: Address already in use in bind()
The client (butt in this case) stays connected and streaming. Eventually the logs are flooded with:
[input.harbor.ssl_0:3] Buffer overrun: Dropping 0.02s. Consider increasing the max buffer size!
To Reproduce Stripped down script:
This also happens in production when ls crashes and input.harbor is connected. ls never fully shuts down and continuously floods the logs with Buffer overruns.
Expected behavior ls should shut down, disconnect all inputs, and restart cleanly.
Version details