Hello!
Thanks Romain it actually works (I think)!
Setting an very large return value for on_error and forcing a
source.shutdown() on the active_source of the output.x did the trick:
the output stops but Liquidsoap still runs!
Thanks!
P.S. Now I have some errors when I try to re-open an output.X with the
same parameters as the one that just failed :), but I think it has to do
with my script, I'll investigate. Maybe I also need to perform a
source.shutdown individually on all sources that are combined to produce
the active_source that has just stopped?
2013/10/22 23:44:38 [clock.wallclock_main:2] Error when starting /play:
Lang.Invalid_value(_, "A source is already register for this
mountpointpoint '/' and port 8030.")!
2013/10/22 23:44:38 [clock.wallclock_main:3] Raised at file "list.ml",
line 144, characters 16-25
2013/10/22 23:44:38 [/play:1] Got ill-balanced activations (from /play)!
2013/10/22 23:44:38 [clock:2] Error when leaving output /play: File
"source.ml", line 396, characters 10-16: Assertion failed!
Longer log snippet attached.
On 22/10/2013 14:33, Romain Beauxis wrote:
Actually, on a second though, have you tried to set the return value
of the on_error callback to a high value and then calling
source.shutdown on output.icecast? That would probably work...
2013/10/22 Romain Beauxis <[email protected]>:
Hi,
2013/10/17 okay_awright <[email protected]>:
Hello everyone, I have a simple question which is apparently difficult
to answer.
If output.icecast fails, then Liquidsoap also shuts down, plain and
simple; how can I prevent that from happening?
This behaviour is indeed described here
http://savonet.sourceforge.net/doc-svn/on2_part1.html : "Notice that
liquidsoap only attempts once to reconnect, then fails and shuts down.
For another behavior that tolerates more persistent failures, set
restart=true."
I'd really like Liquidsoap not to exit in those situtations, but I also
don't want it to endlessly retry to connect. I can already make it try
not to automatically reconnect by overriding the default "onError" event
and even destroy and clean up its associated source, but then I am stuck
in trying to prevent Liquidsoap not to shut down when it cannot
communicate with the media server anymore. I have a complex script that
can take care of connection losses and try another server to communicate
with when it happens. I can use a phony output.dummy(blank()) at script
launch time to fake Liquidsoap in believing that something is playing
all the time (or even use the "init.force_start" directive), waiting to
open a new output.icecast connection to another server with
add_timeout() and a fresh source.
Is it possible? Can I do it using the Liquidsoap 1.1.1 script language?
What's the reason behind such a default behaviour (i.e. no control over
automatic shutdowns)?
It is not possible at the moment. When an error occurs, either
on_error returns a strictly positive number and connection is
attempted again or an exception is raised.
While your use case makes sense, it is also quite advanced. I will try
to think of a way to allow this without making the operator even more
complex..
Romain
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users
--
regards,
okay_awright
<okay_awright AT ddcr DOT biz>
...
2013/10/22 23:44:17 [lang:3] sending heartbeat
2013/10/22 23:44:17 [lang:3] shampoo_ws_setter():
http://localhost:8080/Shampoo/ws/http/streamer/channel/heartbeat;n=1&k=hackme!&p=15031254500903
2013/10/22 23:44:18 [buffer_6353:4] Buffer emptied, buffering needed.
2013/10/22 23:44:19 [buffer_6353:4] Activations changed: static=[], dynamic=[].
2013/10/22 23:44:19 [source:4] Source buffer_6353 gets down.
2013/10/22 23:44:27 [lang:3] sending heartbeat
2013/10/22 23:44:27 [lang:3] shampoo_ws_setter():
http://localhost:8080/Shampoo/ws/http/streamer/channel/heartbeat;n=1&k=hackme!&p=15031254500903
2013/10/22 23:44:30 [/play:2] Error while sending data: could not write data to
host: Connection reset by peer in write()!
**********************ON_ERROR_EVENT_TRIGGERED
2013/10/22 23:44:30 [lang:3] error detected: could not write data to host:
Connection reset by peer in write()
2013/10/22 23:44:30 [/play:3] Closing connection...
2013/10/22 23:44:30 [/play:3] Will try to reconnect in 10000.00 seconds.
2013/10/22 23:44:30 [/play:4] Activations changed: static=[], dynamic=[].
2013/10/22 23:44:30 [source:4] Source /play gets down.
----------------------ON_STOP_EVENT_TRIGGERED
2013/10/22 23:44:30 [lang:3] notifying seat 1 is now free
2013/10/22 23:44:30 [lang:3] shampoo_ws_setter():
http://localhost:8080/Shampoo/ws/http/streamer/off;n=1&k=hackme!&p=15031254500903
2013/10/22 23:44:30 [lang:3] channel Test has stopped
2013/10/22 23:44:30 [compress_6228:4] Activations changed: static=[],
dynamic=[].
2013/10/22 23:44:30 [source:4] Source compress_6228 gets down.
2013/10/22 23:44:30 [normalize_6227:4] Activations changed: static=[],
dynamic=[].
2013/10/22 23:44:30 [source:4] Source normalize_6227 gets down.
2013/10/22 23:44:30 [fallback_6226:4] Activations changed: static=[],
dynamic=[].
2013/10/22 23:44:30 [source:4] Source fallback_6226 gets down.
2013/10/22 23:44:30 [normalize_6211:4] Activations changed: static=[],
dynamic=[].
2013/10/22 23:44:30 [source:4] Source normalize_6211 gets down.
2013/10/22 23:44:30 [on_metadata_6210:4] Activations changed: static=[],
dynamic=[].
2013/10/22 23:44:30 [source:4] Source on_metadata_6210 gets down.
2013/10/22 23:44:30 [strip_blank_6209:4] Activations changed:
static=[strip_blank_6209], dynamic=[].
2013/10/22 23:44:30 [smart_cross_6222:4] Activations changed:
static=[fallback_6226:normalize_6227:compress_6228:/play:/play], dynamic=[].
2013/10/22 23:44:30 [smart_cross_6222:4] Activations changed: static=[],
dynamic=[].
2013/10/22 23:44:30 [source:4] Source smart_cross_6222 gets down.
2013/10/22 23:44:30 [sequence_6394:4] Activations changed: static=[],
dynamic=[].
2013/10/22 23:44:30 [source:4] Source sequence_6394 gets down.
2013/10/22 23:44:30 [smart_cross_6222_after:4] Activations changed: static=[],
dynamic=[].
2013/10/22 23:44:30 [source:4] Source smart_cross_6222_after gets down.
2013/10/22 23:44:30 [on_metadata_6221:4] Activations changed: static=[],
dynamic=[smart_cross_6222].
2013/10/22 23:44:30 [on_metadata_6221:4] Activations changed: static=[],
dynamic=[].
2013/10/22 23:44:30 [source:4] Source on_metadata_6221 gets down.
2013/10/22 23:44:30 [on_track_6220:4] Activations changed: static=[],
dynamic=[].
2013/10/22 23:44:30 [source:4] Source on_track_6220 gets down.
2013/10/22 23:44:30 [normalize_6219:4] Activations changed: static=[],
dynamic=[].
2013/10/22 23:44:30 [source:4] Source normalize_6219 gets down.
2013/10/22 23:44:30 [eat_blank_6218:4] Activations changed: static=[],
dynamic=[].
2013/10/22 23:44:30 [source:4] Source eat_blank_6218 gets down.
2013/10/22 23:44:30 [skip_blank_6217:4] Activations changed: static=[],
dynamic=[].
2013/10/22 23:44:30 [source:4] Source skip_blank_6217 gets down.
2013/10/22 23:44:30 [cue_cut_6213:4] Activations changed: static=[], dynamic=[].
2013/10/22 23:44:30 [source:4] Source cue_cut_6213 gets down.
2013/10/22 23:44:30 [queue_1:4] Activations changed: static=[], dynamic=[].
2013/10/22 23:44:30 [source:4] Source queue_1 gets down.
2013/10/22 23:44:30 [queue_1:4] Waiting for feeding task to stop...
2013/10/22 23:44:30 [queue_1:3] Finished with
"/cygdrive/e/Sources/Shampoo096/0.9.6/Liquidsoap/res/offair.ogg".
2013/10/22 23:44:30 [queue_1:4] Cleaning up request queue...
----------------------REALLOCATING_ANEW
2013/10/22 23:44:37 [lang:3] allocating seat 1
2013/10/22 23:44:37 [lang:3] shampoo_ws_getter():
http://localhost:8080/Shampoo/ws/http/streamer/channels/available/metadata?n=1&k=hackme!&f=LiquidsoapJSON
2013/10/22 23:44:38 [lang:3] acquiring channel Test with self-key 15031227450820
2013/10/22 23:44:38 [lang:3] shampoo_ws_setter():
http://localhost:8080/Shampoo/ws/http/streamer/on;n=1&c=Test&k=hackme!&p=15031227450820&mq=2&u=http%3A%2F%2Flocalhost%3A8000%2Fplay&md=2000&ql=false&qb=true&qbzf=60.&qbu=blank%3Adefault&f=LiquidsoapJSON&ua=Liquidsoap%2F1.0.1+%5BCygwin%5D+PID50312&l=100000
2013/10/22 23:44:38 [clock:4] Currently 5 clocks allocated.
2013/10/22 23:44:38 [clock.wallclock_main:4] Starting 3 sources...
2013/10/22 23:44:38 [source:4] Source output.dummy_6414 gets up.
2013/10/22 23:44:38 [source:4] Source blank_6413 gets up.
2013/10/22 23:44:38 [blank_6413:4] Content kind is {audio=2;video=0;midi=0}.
2013/10/22 23:44:38 [blank_6413:4] Activations changed: static=[dummy:dummy],
dynamic=[].
2013/10/22 23:44:38 [dummy(dot)1:4] Activations changed: static=[dummy(dot)1],
dynamic=[].
2013/10/22 23:44:38 [dummy(dot)1:4] Enabling caching mode: active source.
2013/10/22 23:44:38 [source:4] Source output.icecast_6439 gets up.
2013/10/22 23:44:38 [source:4] Source compress_6437 gets up.
2013/10/22 23:44:38 [compress_6437:4] Content kind is {audio=2;video=0;midi=0}.
2013/10/22 23:44:38 [source:4] Source normalize_6436 gets up.
2013/10/22 23:44:38 [normalize_6436:4] Content kind is {audio=2;video=0;midi=0}.
2013/10/22 23:44:38 [source:4] Source fallback_6435 gets up.
2013/10/22 23:44:38 [source:4] Source normalize_6420 gets up.
2013/10/22 23:44:38 [normalize_6420:4] Content kind is {audio=2;video=0;midi=0}.
2013/10/22 23:44:38 [source:4] Source on_metadata_6419 gets up.
2013/10/22 23:44:38 [on_metadata_6419:4] Content kind is
{audio=2;video=0;midi=0}.
2013/10/22 23:44:38 [source:4] Source strip_blank_6418 gets up.
2013/10/22 23:44:38 [strip_blank_6418:4] Content kind is
{audio=2;video=0;midi=0}.
2013/10/22 23:44:38 [source:4] Source map_metadata_6417 gets up.
2013/10/22 23:44:38 [map_metadata_6417:4] Content kind is
{audio=2;video=0;midi=0}.
2013/10/22 23:44:38 [source:4] Source live_1 gets up.
2013/10/22 23:44:38 [live_1:4] Content kind is {audio=2;video=0;midi=0}.
2013/10/22 23:44:38 [clock.wallclock_main:2] Error when starting /play:
Lang.Invalid_value(_, "A source is already register for this mountpointpoint
'/' and port 8030.")!
2013/10/22 23:44:38 [clock.wallclock_main:3] Raised at file "list.ml", line
144, characters 16-25
2013/10/22 23:44:38 [/play:1] Got ill-balanced activations (from /play)!
2013/10/22 23:44:38 [clock:2] Error when leaving output /play: File
"source.ml", line 396, characters 10-16: Assertion failed!
2013/10/22 23:44:38 [source:4] Source strip_blank_6418 gets up.
2013/10/22 23:44:38 [strip_blank_6418:4] Content kind is
{audio=2;video=0;midi=0}.
2013/10/22 23:44:38 [source:4] Source map_metadata_6417 gets up.
2013/10/22 23:44:38 [map_metadata_6417:4] Content kind is
{audio=2;video=0;midi=0}.
2013/10/22 23:44:38 [source:4] Source live_1 gets up.
2013/10/22 23:44:38 [live_1:4] Content kind is {audio=2;video=0;midi=0}.
2013/10/22 23:44:38 [clock.wallclock_main:2] Error when starting
strip_blank_6418: Lang.Invalid_value(_, "A source is already register for this
mountpointpoint '/' and port 8030.")!
2013/10/22 23:44:38 [strip_blank_6418:1] Got ill-balanced activations (from
strip_blank_6418)!
2013/10/22 23:44:38 [clock:2] Error when leaving output strip_blank_6418: File
"source.ml", line 396, characters 10-16: Assertion failed!
...------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users