8000 webostv keeps files open until file limit is reached · Issue #6749 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

webostv keeps files open until file limit is reached #6749

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

Closed
hmn opened this issue Mar 23, 2017 · 4 comments · Fixed by #7184 or #7199
Closed

webostv keeps files open until file limit is reached #6749

hmn opened this issue Mar 23, 2017 · 4 comments · Fixed by #7184 or #7199

Comments

@hmn
Copy link
Contributor
hmn commented Mar 23, 2017

I run the newest version of the docker image (0.40.2) and experience problems with the lg webos component

Home Assistant release (hass --version):
0.40.2

Python release (python3 --version):
Python 3.5.3

Component/platform:
webostv

Description of problem:
when enabling the media_player webostv for my LG OLEDE6V tv it works fine but keeps opening connections as if it is waiting for something, and after a number of hours it reaches the max open files on the docker image with is 4096

Expected:
when the component is disabled hass works fine and never crashes, and the file descriptors look like this

ls -al /proc/17708/fd
total 0
dr-x------  2 root root  0 Mar 23 10:55 .
dr-xr-xr-x  8 root root  0 Mar 23 10:55 ..
lr-x------  1 root root 64 Mar 23 10:55 0 -> pipe:[123901525]
l-wx------  1 root root 64 Mar 23 10:55 1 -> pipe:[123901526]
lrwx------  1 root root 64 Mar 23 11:07 10 -> socket:[123904480]
lrwx------  1 root root 64 Mar 23 11:07 11 -> socket:[123904481]
l-wx------+ 1 root root 64 Mar 23 11:07 12 -> /config/home-assistant.log
lr-x------  1 root root 64 Mar 23 11:07 14 -> /dev/null
lrwx------  1 root root 64 Mar 23 11:07 15 -> socket:[123907221]
lrwx------  1 root root 64 Mar 23 11:07 16 -> socket:[123985506]
lrwx------  1 root root 64 Mar 23 11:07 17 -> socket:[123985507]
lrwx------  1 root root 64 Mar 23 11:07 18 -> socket:[123985508]
lrwx------  1 root root 64 Mar 23 11:07 19 -> socket:[123906387]
l-wx------  1 root root 64 Mar 23 10:55 2 -> pipe:[123901527]
lrwx------  1 root root 64 Mar 23 11:07 20 -> socket:[123907813]
lrwx------  1 root root 64 Mar 23 11:07 21 -> socket:[123985509]
lrwx------  1 root root 64 Mar 23 11:07 22 -> socket:[123985510]
lrwx------  1 root root 64 Mar 23 11:07 26 -> socket:[123985808]
lrwx------  1 root root 64 Mar 23 11:07 28 -> socket:[123992974]
lrwx------  1 root root 64 Mar 23 11:07 29 -> socket:[123906430]
lr-x------  1 root root 64 Mar 23 11:07 3 -> /dev/urandom
lrwx------  1 root root 64 Mar 23 11:07 30 -> socket:[123906432]
lr-x------  1 root root 64 Mar 23 11:07 4 -> pipe:[123904478]
l-wx------  1 root root 64 Mar 23 11:07 5 -> pipe:[123904478]
lrwx------  1 root root 64 Mar 23 11:07 6 -> anon_inode:[eventpoll]
lr-x------  1 root root 64 Mar 23 11:07 7 -> pipe:[123904479]
l-wx------  1 root root 64 Mar 23 11:07 8 -> pipe:[123904479]
lrwx------  1 root root 64 Mar 23 11:07 9 -> anon_inode:[eventfd]

Problem-relevant configuration.yaml entries and steps to reproduce:
when I enable the config for the webostv hass start crasing with the open files limit

- platform: webostv
  host: 10.254.2.192
  mac: C8:08:E9:F3:85:DA
  name: LG OLED

after a couple of minutes with the webos component open the file descriptors look like this

ls -al /proc/24168/fd
total 0
dr-x------  2 root root  0 Mar 23 11:12 .
dr-xr-xr-x  8 root root  0 Mar 23 11:12 ..
lr-x------  1 root root 64 Mar 23 11:12 0 -> pipe:[124043082]
l-wx------  1 root root 64 Mar 23 11:12 1 -> pipe:[124043083]
lrwx------  1 root root 64 Mar 23 11:13 10 -> socket:[124042134]
lrwx------  1 root root 64 Mar 23 11:13 11 -> socket:[124042135]
l-wx------+ 1 root root 64 Mar 23 11:13 12 -> /config/home-assistant.log
lrwx------  1 root root 64 Mar 23 11:13 13 -> anon_inode:[eventpoll]
lrwx------  1 root root 64 Mar 23 11:13 14 -> anon_inode:[eventpoll]
lr-x------  1 root root 64 Mar 23 11:13 15 -> pipe:[124048316]
lr-x------  1 root root 64 Mar 23 11:13 16 -> /dev/null
l-wx------  1 root root 64 Mar 23 11:13 17 -> pipe:[124048316]
lrwx------  1 root root 64 Mar 23 11:13 18 -> socket:[124044420]
lr-x------  1 root root 64 Mar 23 11:13 19 -> pipe:[124046612]
l-wx------  1 root root 64 Mar 23 11:12 2 -> pipe:[124043084]
lrwx------  1 root root 64 Mar 23 11:13 20 -> socket:[124046725]
l-wx------  1 root root 64 Mar 23 11:13 21 -> pipe:[124046612]
lrwx------  1 root root 64 Mar 23 11:13 22 -> anon_inode:[eventfd]
lr-x------  1 root root 64 Mar 23 11:13 23 -> /dev/null
lrwx------  1 root root 64 Mar 23 11:14 24 -> anon_inode:[eventpoll]
lrwx------  1 root root 64 Mar 23 11:13 25 -> anon_inode:[eventfd]
lr-x------  1 root root 64 Mar 23 11:13 26 -> /dev/null
lrwx------  1 root root 64 Mar 23 11:14 27 -> anon_inode:[eventpoll]
lr-x------  1 root root 64 Mar 23 11:14 28 -> pipe:[124052006]
l-wx------  1 root root 64 Mar 23 11:14 29 -> pipe:[124052006]
lr-x------  1 root root 64 Mar 23 11:13 3 -> /dev/urandom
lrwx------  1 root root 64 Mar 23 11:14 30 -> anon_inode:[eventfd]
lr-x------  1 root root 64 Mar 23 11:14 31 -> pipe:[124056598]
lrwx------  1 root root 64 Mar 23 11:13 32 -> anon_inode:[eventpoll]
lrwx------  1 root root 64 Mar 23 11:13 33 -> socket:[124035881]
lrwx------  1 root root 64 Mar 23 11:13 34 -> socket:[124047682]
lrwx------  1 root root 64 Mar 23 11:13 35 -> socket:[124047683]
lrwx------  1 root root 64 Mar 23 11:13 36 -> socket:[124071244]
lrwx------  1 root root 64 Mar 23 11:13 37 -> anon_inode:[eventpoll]
l-wx------  1 root root 64 Mar 23 11:14 38 -> pipe:[124056598]
lr-x------  1 root root 64 Mar 23 11:13 39 -> pipe:[124047890]
lr-x------  1 root root 64 Mar 23 11:13 4 -> pipe:[124042132]
l-wx------  1 root root 64 Mar 23 11:13 40 -> pipe:[124047890]
lrwx------  1 root root 64 Mar 23 11:13 41 -> anon_inode:[eventfd]
lr-x------  1 root root 64 Mar 23 11:13 42 -> /dev/null
lr-x------  1 root root 64 Mar 23 11:14 43 -> /dev/null
lrwx------  1 root root 64 Mar 23 11:13 44 -> anon_inode:[eventpoll]
lrwx------  1 root root 64 Mar 23 11:14 45 -> anon_inode:[eventfd]
lr-x------  1 root root 64 Mar 23 11:14 46 -> /dev/null
lrwx------  1 root root 64 Mar 23 11:14 47 -> anon_inode:[eventpoll]
lr-x------  1 root root 64 Mar 23 11:14 48 -> pipe:[124059736]
l-wx------  1 root root 64 Mar 23 11:14 49 -> pipe:[124059736]
l-wx------  1 root root 64 Mar 23 11:13 5 -> pipe:[124042132]
lrwx------  1 root root 64 Mar 23 11:14 50 -> anon_inode:[eventfd]
lr-x------  1 root root 64 Mar 23 11:14 51 -> /dev/null
lrwx------  1 root root 64 Mar 23 11:14 52 -> anon_inode:[eventpoll]
lr-x------  1 root root 64 Mar 23 11:14 53 -> pipe:[124058442]
l-wx------  1 root root 64 Mar 23 11:14 54 -> pipe:[124058442]
lrwx------  1 root root 64 Mar 23 11:14 55 -> anon_inode:[eventfd]
lr-x------  1 root root 64 Mar 23 11:14 56 -> /dev/null
lr-x------  1 root root 64 Mar 23 11:14 57 -> pipe:[124055430]
l-wx------  1 root root 64 Mar 23 11:14 58 -> pipe:[124055430]
lrwx------  1 root root 64 Mar 23 11:14 59 -> anon_inode:[eventfd]
lrwx------  1 root root 64 Mar 23 11:13 6 -> anon_inode:[eventpoll]
lr-x------  1 root root 64 Mar 23 11:14 60 -> /dev/null
lrwx------  1 root root 64 Mar 23 11:14 61 -> anon_inode:[eventpoll]
lrwx------  1 root root 64 Mar 23 11:15 62 -> anon_inode:[eventpoll]
lr-x------  1 root root 64 Mar 23 11:15 63 -> pipe:[124070960]
l-wx------  1 root root 64 Mar 23 11:15 64 -> pipe:[124070960]
lrwx------  1 root root 64 Mar 23 11:15 65 -> anon_inode:[eventfd]
lr-x------  1 root root 64 Mar 23 11:15 66 -> /dev/null
lrwx------  1 root root 64 Mar 23 11:15 67 -> anon_inode:[eventpoll]
lr-x------  1 root root 64 Mar 23 11:15 68 -> pipe:[124070763]
l-wx------  1 root root 64 Mar 23 11:15 69 -> pipe:[124070763]
lr-x------  1 root root 64 Mar 23 11:13 7 -> pipe:[124042133]
lrwx------  1 root root 64 Mar 23 11:15 70 -> anon_inode:[eventfd]
lr-x------  1 root root 64 Mar 23 11:17 71 -> pipe:[124078442]
lr-x------  1 root root 64 Mar 23 11:15 72 -> /dev/null
l-wx------  1 root root 64 Mar 23 11:17 73 -> pipe:[124078442]
lrwx------  1 root root 64 Mar 23 11:17 74 -> anon_inode:[eventfd]
lr-x------  1 root root 64 Mar 23 11:17 75 -> pipe:[124076016]
lr-x------  1 root root 64 Mar 23 11:17 76 -> /dev/null
l-wx------  1 root root 64 Mar 23 11:17 77 -><
8000
/span> pipe:[124076016]
lrwx------  1 root root 64 Mar 23 11:17 78 -> anon_inode:[eventfd]
lr-x------  1 root root 64 Mar 23 11:17 79 -> /dev/null
l-wx------  1 root root 64 Mar 23 11:13 8 -> pipe:[124042133]
lrwx------  1 root root 64 Mar 23 11:17 80 -> socket:[124083074]
lrwx------  1 root root 64 Mar 23 11:17 82 -> anon_inode:[eventpoll]
lr-x------  1 root root 64 Mar 23 11:17 83 -> pipe:[124071775]
l-wx------  1 root root 64 Mar 23 11:17 84 -> pipe:[124071775]
lrwx------  1 root root 64 Mar 23 11:17 85 -> anon_inode:[eventfd]
lrwx------  1 root root 64 Mar 23 11:17 86 -> anon_inode:[eventpoll]
lr-x------  1 root root 64 Mar 23 11:17 87 -> pipe:[124071895]
lr-x------  1 root root 64 Mar 23 11:17 88 -> /dev/null
l-wx------  1 root root 64 Mar 23 11:17 89 -> pipe:[124071895]
lrwx------  1 root root 64 Mar 23 11:13 9 -> anon_inode:[eventfd]
lrwx------  1 root root 64 Mar 23 11:17 90 -> anon_inode:[eventfd]
lr-x------  1 root root 64 Mar 23 11:17 91 -> /dev/null

and lines like this just keep stacking up (as if it is running some command and waiting for it to finish

lrwx------  1 root root 64 Mar 23 11:14 50 -> anon_inode:[eventfd]
lr-x------  1 root root 64 Mar 23 11:14 51 -> /dev/null
lrwx------  1 root root 64 Mar 23 11:14 52 -> anon_inode:[eventpoll]
lr-x------  1 root root 64 Mar 23 11:14 53 -> pipe:[124058442]
l-wx------  1 root root 64 Mar 23 11:14 54 -> pipe:[124058442]

after hours of this hass crashes with an open files limit error

Traceback (if applicable):

Additional info:
disabling the component removes the error and if I enable it I get it back so it should be reproducable

@moskovskiy82
Copy link

Thank you for posting! I couln't pin point the faulty component which also led to maximum files open on Raspbian and so crashing HASS!

@moskovskiy82
Copy link

4 days with comonent disabled and no more crashes. No more extra open files.

@hmn
Copy link
Contributor Author
hmn commented Apr 15, 2017

I tried fixing the pylgtv module so it handles timeouts correctly, so hopefully this solves the problem in home assistant

TheRealLink/pylgtv#5

@hmn
Copy link
Contributor Author
hmn commented Apr 20, 2017

unfortunately the timeout stuff was not the only problem in the pylgtv module, the reason for the crash was an asyncio thread leak

I'l update the code and wait for the maintainer to release it and then create a new pull request

TheRealLink/pylgtv#6

@home-assistant home-assistant locked and limited conversation to collaborators Aug 12, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants
0