[ 
http://dev.sourcefabric.org/browse/LS-532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18239#action_18239
 ] 

David Baelde commented on LS-532:
---------------------------------

While reviewing the code I found another problem, I'll fix it but here's an 
explanation for the record...

We had to avoid raising exceptions when #output_get_ready fails, but catch 
them, finish the #start_outputs, so that shutdown cleanly works. If 
#start_output is interrupted, some sources that started will be ignored from 
the shutdown (#sleep is never called for them) and shutdown hangs while waiting 
for their thread.

For #get_ready there was no such protection. I managed to create a freeze by 
putting an assert false in output.dummy()'s #wake_up and with the following 
example:
./src/liquidsoap --debug 'x=blank() 
output.pulseaudio(fallible=true,add([x,input.http("http://dbaelde:dbae...@mrpingouin.is-a-geek.ogg:8000/friends.ogg";)]))
 output.dummy(x)'
(It is important that the dummy output is in the same clock as the pulse 
output, and to have an http input that can freeze the shutdown.)

Therefore I'm changing that part of the initialization code too. I was 
reluctant without an example because we don't get as much backtraces after the 
change.

> Freeze after exception in streaming thread (other outputs never shutdown)
> -------------------------------------------------------------------------
>
>                 Key: LS-532
>                 URL: http://dev.sourcefabric.org/browse/LS-532
>             Project: Liquidsoap
>          Issue Type: Bug
>          Components: Liquidsoap
>         Environment: Liquidsoap 1.0.0-beta+svn (@:20110515:103042).
> Linux wbox-turm 2.6.32-31-generic #61-Ubuntu SMP Fri Apr 8 18:24:35 UTC 2011 
> i686 GNU/Linux
>            Reporter: peter
>            Assignee: David Baelde
>            Priority: Major
>
> if input is alsa or pulseaudio and output is connected to a local icecast2, 
> liquidsoap dies in case of shutting down icecast2.
> test steps:
> start liquidsoap
> sudo start icecast2
> play icecast stream with player
> sudo stop icecast2
> configuration:
> channel               = mksafe(input.alsa())
> #channel      = mksafe(input.pulseaudio())
> #channel      = mksafe(input.alsa(device="pcm.liquidsoap"))
> radio=channel
> radio=limit(radio)
> output.icecast(
>       %vorbis.cbr(samplerate=44100, channels=2, bitrate=160),
>       host="localhost", port=4565, user="liquidsoap", password="hack", 
> mount="/radio", description="text"
>       restart=true,
>       radio
> )
> output.file(
>       %mp3(bitrate=160,stereo=true, samplerate=44100),
>       "/mnt/archive/potsdam/%Y-%m-%d/%Y-%m-%d-%H_%M_%S.mp3", 
>       reopen_when={0m0s},
>       radio
> )
> with alsa:
> /var/log/icecast2/error.log   [2011-05-18  22:04:02] INFO source/source_main 
> listener count on /radio now 0
> /var/log/icecast2/error.log   [2011-05-18  22:04:19] INFO source/source_main 
> listener count on /radio now 1
> /var/log/icecast2/error.log   [2011-05-18  22:04:29] INFO sighandler/_sig_die 
> Caught signal 15, shutting down...
> /var/log/liquidsoap/play.log  2011/05/18 22:04:30 [/radio:2] Cry socket 
> error: could not write data to host: Broken pipe in write()!
> /var/log/liquidsoap/play.log  2011/05/18 22:04:30 [/radio:3] Closing 
> connection...
> /var/log/liquidsoap/play.log  2011/05/18 22:04:30 [threads:1] Thread 
> "wallclock_alsa" aborts with exception Cry error: could not close connection: 
> Transport endpoint is not connected in shutdown()!
> /var/log/liquidsoap/play.log  2011/05/18 22:04:30 [threads:3] Raised by 
> primitive operation at file "", line 0, characters 0-0
> /var/log/liquidsoap/play.log  2011/05/18 22:04:30 [main:3] Shutdown started!
> /var/log/liquidsoap/play.log  2011/05/18 22:04:30 [main:3] Waiting for 
> threads to terminate...
> /var/log/icecast2/error.log   [2011-05-18  22:04:29] INFO 
> source/source_shutdown Source "/radio" exiting
> /var/log/icecast2/error.log   [2011-05-18  22:04:29] INFO main/main Shutting 
> down
> /var/log/icecast2/error.log   [2011-05-18  22:04:29] INFO 
> fserve/fserve_shutdown file serving thread stopped
> /var/log/icecast2/error.log   [2011-05-18  22:04:30] INFO slave/_slave_thread 
> shutting down current relays
> /var/log/icecast2/error.log   [2011-05-18  22:04:30] INFO slave/_slave_thread 
> Slave thread shutdown complete
> /var/log/icecast2/error.log   [2011-05-18  22:04:30] INFO auth/auth_shutdown 
> Auth shutdown
> /var/log/icecast2/error.log   [2011-05-18  22:04:30] INFO yp/yp_shutdown YP 
> thread down
> /var/log/icecast2/error.log   [2011-05-18  22:04:30] INFO 
> stats/stats_shutdown stats thread finished
> /var/log/syslog       May 18 22:04:31 wbox-turm init: icecast2 main process 
> (12201) terminated with status 255
> and for pulseaudio:
> /var/log/icecast2/error.log   [2011-05-18  22:11:56] INFO 
> source/source_move_clients passing 0 listeners to "/radio"
> /var/log/icecast2/error.log   [2011-05-18  22:11:56] INFO 
> format-vorbis/initial_vorbis_page seen initial vorbis header
> /var/log/icecast2/error.log   [2011-05-18  22:11:57] INFO source/source_main 
> listener count on /radio now 0
> /var/log/icecast2/error.log   [2011-05-18  22:12:04] INFO source/source_main 
> listener count on /radio now 1
> /var/log/liquidsoap/play.log  2011/05/18 22:12:16 [/radio:2] Cry socket 
> error: could not write data to host: Broken pipe in write()!
> /var/log/liquidsoap/play.log  2011/05/18 22:12:16 [/radio:3] Closing 
> connection...
> /var/log/liquidsoap/play.log  2011/05/18 22:12:16 [threads:1] Thread 
> "wallclock_pulse" aborts with exception Cry error: could not close 
> connection: Transport endpoint is not connected in shutdown()!
> /var/log/liquidsoap/play.log  2011/05/18 22:12:16 [threads:3] Raised by 
> primitive operation at file "", line 0, characters 0-0
> /var/log/liquidsoap/play.log  2011/05/18 22:12:16 [main:3] Shutdown started!
> /var/log/liquidsoap/play.log  2011/05/18 22:12:16 [main:3] Waiting for 
> threads to terminate...
> /var/log/liquidsoap/play.log  2011/05/18 22:12:16 [main:3] Cleaning 
> downloaded files...
> /var/log/liquidsoap/play.log  2011/05/18 22:12:16 >>> LOG END
> /var/log/icecast2/error.log   [2011-05-18  22:12:16] INFO sighandler/_sig_die 
> Caught signal 15, shutting down...
> /var/log/icecast2/error.log   [2011-05-18  22:12:16] INFO 
> source/source_shutdown Source "/radio" exiting
> /var/log/icecast2/error.log   [2011-05-18  22:12:16] INFO main/main Shutting 
> down
> /var/log/icecast2/error.log   [2011-05-18  22:12:16] INFO 
> fserve/fserve_shutdown file serving thread stopped
> BR, Peter

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://dev.sourcefabric.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Savonet-devl mailing list
Savonet-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-devl

Répondre à