eandersson / amqpstorm

Thread-safe Python RabbitMQ Client & Management library
https://www.amqpstorm.io/
MIT License
186 stars 36 forks source link

filedescriptor out of range in select() #131

Open Alexei17 opened 6 months ago

Alexei17 commented 6 months ago

Happens when you have lots of processes (I had about 150) that constantly restart connections. Happens because of the 1024 limit on FD_SETSIZE. More info here: https://stackoverflow.com/questions/14250751/how-to-increase-filedescriptors-range-in-python-select


Exception in thread amqpstorm.io:
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.11/dist-packages/amqpstorm/io.py", line 259, in _process_incoming_data
    if self.poller.is_ready:
       ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/amqpstorm/io.py", line 45, in is_ready
    ready, _, _ = self.select.select([self.fileno], [], [],
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: filedescriptor out of range in select()