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

websockets fail to start after quick restart #635

Open
ejurgensen opened this issue Dec 8, 2018 · 2 comments
Open

websockets fail to start after quick restart #635

ejurgensen opened this issue Dec 8, 2018 · 2 comments
Assignees

Comments

@ejurgensen
Copy link
Member

For testing, I have a script that kills and immediately restarts forked-daapd. I have noticed that sometimes it fails to start. It seems related to libwebsockets:

[2018-12-09 00:33:24] [DEBUG]      web: LWS Initial logging level 31
[2018-12-09 00:33:24] [DEBUG]      web: LWS Libwebsockets version: 2.0.3 unknown-build-hash
[2018-12-09 00:33:24] [DEBUG]      web: LWS IPV6 not compiled in
[2018-12-09 00:33:24] [DEBUG]      web: LWS libev support compiled in but disabled
[2018-12-09 00:33:24] [DEBUG]      web: LWS libuv support compiled in but disabled
[2018-12-09 00:33:24] [DEBUG]      web: LWS  Threads: 1 each 1024 fds
[2018-12-09 00:33:24] [DEBUG]      web: LWS  mem: platform fd map:  8192 bytes
[2018-12-09 00:33:24] [DEBUG]      web: LWS  Compiled with OpenSSL support
[2018-12-09 00:33:24] [DEBUG]      web: LWS  SSL disabled: no LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
[2018-12-09 00:33:24] [DEBUG]      web: LWS Creating Vhost 'default' port 3688, 2 protocols
[2018-12-09 00:33:24] [  LOG]      web: LWS ERROR on binding fd 49 to port 3688 (-1 98)
[2018-12-09 00:33:24] [  LOG]      web: LWS Failed to create default vhost
[2018-12-09 00:33:24] [  LOG]      web: Failed to create websocket context
[2018-12-09 00:33:24] [FATAL]    httpd: Websocket init failed

This is with Ubuntu 16.04.

@chme can you see if there is anything to do about it?

@ejurgensen ejurgensen assigned ejurgensen and chme and unassigned ejurgensen Dec 8, 2018
@chme
Copy link
Collaborator

chme commented Dec 16, 2018

Looks like the port is not immediately available after killing forked-daapd. I am not able to reproduce it on my notebook running solus as distribution (even with open connections to the websocket, killing and restarting works fine). I have no clue what can be done about that ... and did not find anything helpful searching the web.

@ejurgensen
Copy link
Member Author

Thanks for looking into it. I was hoping there might be some libwebsocket option to fix it, maybe something that makes it use SO_REUSEADDR when it tries to bind to the port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants