GNOME Bugzilla – Bug 678982
filesink: handle broken pipe
Last modified: 2015-07-29 14:46:50 UTC
Created attachment 217401 [details] [review] handle broken pipe error Please try this: mkfifo /tmp/test.fifo gst-launch videotestsrc ! gdppay ! filesink location=/tmp/test.fifo gst-launch -v -m -t filesrc location=/tmp/test.fifo ! gdpdepay ! fakesink if you stop the second pipeline the first one will exit without handle the error (broken pipe), patch attached
probably is more useful handle sigpipe everywhere so something some a global init method would be more appropriate to handle sigpipe, so all elements will handle that signal, Nicola
you can't use signals in elements. I believe there is a write variant that allows you to catch these errors in a different way.
Hi, after some searching seems that sigpipe can be handled in several ways for network sockets, I cannot find the equivalent for file writing (write,fwrite) apart the method suggested in the patch, can you give some pointers to properly handle sigpipe in filesink? thanks Nicola
and please explain why is a bad idea to add: signal(SIGPIPE, SIG_IGN); in the gstreamer init method (something like gst_init), so all elements can benefit from this
Nicola: because GStreamer is a library, and a library usually has no business messing with global process state that affects non-GStreamer threads such as application threads or other libraries. I believe there are ways to suppress sigpipe for one particular thread though, but I'm not sure we want such code in filesink tbh.
thanks Tim, I get it now, you are suggesting to set signal(SIGPIPE, SIG_IGN) in the app that use gstreamer so all gstreamer elements used in the app automatically ignore sigpipe, I'll try this and if it works I think this bug should be closed as wont fix and maybe the code to ignore sigpipe should be added to gst-launch
Here is something interesting: http://krokisplace.blogspot.com.es/2010/02/suppressing-sigpipe-in-library.html
Wim, thanks for the link, very interesting Tim, Wim, please advice if you want something that manage broken pipe inside filesink (a property?) or if it is more appropriate manage that in the app, outside gstreamer, I think other elements are affected too. If you want something inside filesink I could try to make a patch
Maybe we just add something to the api-docs for it and maybe add a example to tests/examples/.
Just docs and an example sound enough for me, anybody still has the need for that?
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment. Thanks!