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

OSError: [Errno 24] Too many open files #122

Closed
caumons opened this issue Aug 22, 2018 · 1 comment
Closed

OSError: [Errno 24] Too many open files #122

caumons opened this issue Aug 22, 2018 · 1 comment

Comments

@caumons
Copy link

caumons commented Aug 22, 2018

After upgrading channels_redis from version 2.2.1 to 2.3 I'm periodically getting the following exception. I've had to downgrade to version 2.2.1 again to fix it.

Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/home/dev/virtualenvs/myproj/lib/python3.5/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/home/dev/virtualenvs/myproj/lib/python3.5/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/dev/virtualenvs/myproj/lib/python3.5/site-packages/django/core/management/base.py", line 316, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/dev/virtualenvs/myproj/lib/python3.5/site-packages/django/core/management/base.py", line 353, in execute
    output = self.handle(*args, **options)
  File "/home/dev/myproj/myfile.py", line 62, in handle
    self.send_to_ws('update_multiplier', multiplier)
  File "/home/dev/myproj/myfile.py", line 24, in send_to_ws
    'data': data,
  File "/home/dev/virtualenvs/myproj/lib/python3.5/site-packages/asgiref/sync.py", line 64, in __call__
    return call_result.result()
  File "/usr/lib/python3.5/concurrent/futures/_base.py", line 398, in result
    return self.__get_result()
  File "/usr/lib/python3.5/concurrent/futures/_base.py", line 357, in __get_result
    raise self._exception
  File "/home/dev/virtualenvs/myproj/lib/python3.5/site-packages/asgiref/sync.py", line 78, in main_wrap
    result = await self.awaitable(*args, **kwargs)
  File "/home/dev/virtualenvs/myproj/lib/python3.5/site-packages/channels_redis/core.py", line 559, in group_send
    async with self.connection(self.consistent_hash(group)) as connection:
  File "/home/dev/virtualenvs/myproj/lib/python3.5/site-packages/channels_redis/core.py", line 742, in __aenter__
    self.conn = await self.pool.pop()
  File "/home/dev/virtualenvs/myproj/lib/python3.5/site-packages/channels_redis/core.py", line 49, in pop
    conns.append(await aioredis.create_redis(**self.host, loop=loop))
  File "/home/dev/virtualenvs/myproj/lib/python3.5/site-packages/aioredis/commands/__init__.py", line 177, in create_redis
    loop=loop)
  File "/home/dev/virtualenvs/myproj/lib/python3.5/site-packages/aioredis/connection.py", line 107, in create_connection
    timeout, loop=loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 387, in wait_for
    return (yield from fut)
  File "/home/dev/virtualenvs/myproj/lib/python3.5/site-packages/aioredis/stream.py", line 19, in open_connection
    lambda: protocol, host, port, **kwds)
  File "/usr/lib/python3.5/asyncio/base_events.py", line 776, in create_connection
    raise exceptions[0]
  File "/usr/lib/python3.5/asyncio/base_events.py", line 743, in create_connection
    sock = socket.socket(family=family, type=type, proto=proto)
  File "/usr/lib/python3.5/socket.py", line 134, in __init__
    _socket.socket.__init__(self, family, type, proto, fileno)
OSError: [Errno 24] Too many open files

I'm using python 3.5.6 and some of the libs are:

aioredis        1.1.0  
asgiref         2.3.2
channels        2.1.3  
django-redis    4.9.0
redis           2.10.6
@andrewgodwin
Copy link
Member

This is a system-level thing - you need to increase your ulimit for file handles (it's likely a small change in that patch version resulted in more file handles). I can't give instructions here for every OS, but if you search for ulimit file handles and your OS name you should find instructions on how to raise it.

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