Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

out of file descriptors using clock.assign_new() on ouput.icecast() #548

Closed
liquidpeter opened this issue May 1, 2018 · 1 comment
Closed
Assignees
Labels

Comments

@liquidpeter
Copy link

liquidpeter commented May 1, 2018

Hi,

I assigned a separate clock to output.icecast as described here:
https://github.com/savonet/liquidsoap/blob/master/doc/content/clocks.txt

I get out of open file descriptors in case the icecast server is not available .
I see an additional used file descriptor on every reconnect to icecast, by default every 3 seconds.

sudo lsof -p 10327 | grep sock 
liquidsoa 10327 audiostream    8u  sock    0,8      0t0 7740934 protocol: TCP
liquidsoa 10327 audiostream    9u  sock    0,8      0t0 7741070 protocol: TCP
liquidsoa 10327 audiostream   10u  sock    0,8      0t0 7746635 protocol: TCP
...

some time later...

do lsof -p 10327 | grep sock | wc -l
163

some time later...

do lsof -p 10327 | grep sock | wc -l
904

At some point you can find in log
2018/04/28 13:19:54 [/radio:2] Connection failed: could not initiate a new handler: Too many open files in socket()

the test script:

radio=sine()
clock.assign_new(id="icecast", [
    output.icecast(
	    %vorbis.cbr(samplerate=44100, channels=2, bitrate=160),
	    host="127.0.0.1", port=8000, 
	    user="source", password="source", 
	    mount="/radio", 
	    description="radio", genre="radio", url="radio",
        mksafe(buffer(radio))
    )
]
)

If additionally a telnet socket is used by a client, the logs are flooded many times a second by
2018/04/28 13:19:57 [server:2] Failed to accept new client: "Too many open files in accept()"
until disk is full. This could be a separate issue. Maybe it could help to limit the output of this log line, for example print it out only once a second.

This has been tested with fresh installation using opam at ubuntu 16.04 LTS.

2018/05/01 20:06:59 [main:3] Liquidsoap 1.3.0+scm (git://github.com/savonet/liquidsoap.git@a3161cc82f9291894a1f8c0ec621bbfc72bbb690:20170507:145246)
2018/05/01 20:06:59 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] pcre=7.1.6 dtools=0.3.3 duppy=0.6.0 duppy.syntax=0.6.0 cry=0.5.0 mm=0.3.0 xmlplaylist=0.1.4 lastfm=0.3.1 ogg=0.5.1 vorbis=0.6.2 opus=0.1.2 mad=0.4.5 flac=0.1.2 flac.ogg=0.1.2 dynlink=[distributed with Ocaml] lame=0.3.3 gstreamer=0.2.3 alsa=0.2.3 samplerate=0.1.4 taglib=0.3.3 magic=0.7.3 camomile=0.8.5 soundtouch=0.1.8 pulseaudio=0.1.3 ladspa=0.1.5 dssi=0.1.2 lo=0.1.1
2018/05/01 20:06:59 [main:2]

Thanks & BR, Peter

@toots
Copy link
Member

toots commented Jul 2, 2018

Hi,

Thanks for this report, this looks pretty interesting. Any chance you could share more logs and/or more details on how to reproduce the issue. In particular, does the output.icecast reconnect a lot?

@toots toots self-assigned this Jul 2, 2018
@toots toots added the bug label Jul 2, 2018
toots added a commit that referenced this issue Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants