Too many files open error when using solver?

I have been running some code (written by a colleague) which calls the hardware solver and it runs successfully for a while but then gives an SSL error claiming there are too many open files. The error output is as follows:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/util/ssl_.py", line 336, in ssl_wrap_socket
OSError: [Errno 24] Too many open filesDuring handling of the above exception, another exception occurred:Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 665, in urlopen
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 376, in _make_request
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 996, in _validate_conn
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 366, in connect
  File "/usr/lib/python3/dist-packages/urllib3/util/ssl_.py", line 338, in ssl_wrap_socket
urllib3.exceptions.SSLError: [Errno 24] Too many open filesDuring handling of the above exception, another exception occurred:Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 719, in urlopen
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 436, in increment
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='cloud.dwavesys.com', port=443): Max retries exceeded with url: /sapi/solvers/remote/DW_2000Q_6/ (Caused by SSLError(OSError(24, 'Too many open files')))During handling of the above exception, another exception occurred:Traceback (most recent call last):
  File "chainstrOHv3_NC.py", line 475, in <module>
  File "chainstrOHv3_NC.py", line 173, in loopThroughConstr
  File "/home/nick/.local/lib/python3.8/site-packages/dwave/system/samplers/dwave_sampler.py", line 162, in __init__
  File "/home/nick/.local/lib/python3.8/site-packages/dwave/cloud/client.py", line 1084, in get_solver
  File "/home/nick/.local/lib/python3.8/site-packages/dwave/cloud/client.py", line 979, in get_solvers
  File "/home/nick/.local/lib/python3.8/site-packages/dwave/cloud/utils.py", line 399, in wrapper
  File "/home/nick/.local/lib/python3.8/site-packages/dwave/cloud/client.py", line 605, in _fetch_solvers
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 546, in get
  File "/home/nick/.local/lib/python3.8/site-packages/dwave/cloud/utils.py", line 297, in request
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
  File "/home/nick/.local/lib/python3.8/site-packages/dwave/cloud/utils.py", line 276, in send
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 514, in send
requests.exceptions.SSLError: HTTPSConnectionPool(host='cloud.dwavesys.com', port=443): Max retries exceeded with url: /sapi/solvers/remote/DW_2000Q_6/ (Caused by SSLError(OSError(24, 'Too many open files')))

I am using Ubuntu, but the same error occurred for a colleague using a Mac, she tried to raise the limit of the number of files which could be open (using ulimit -u ), but that just caused the program to crash silently after a certain number of jobs rather than giving an error code. If it matters, the way the code is structured, the solver call itself happens within another function.

0

Comments

2 comments
  • update: I have tried to test what is going wrong using a software solver such as "c4-sw_sample" but I can't get these solvers to work despite "client.get_solvers()" showing them as available. If anyone can show me how to set up a remote software solver (so I am not wasting my actual QPU quota trying to reproduce the error), I can try to build a minimal example where this problem comes up.

    0
    Comment actions Permalink
  • Update II: problem resolved

     

    The issue has now been resolved, in case anyone else runs into the same problem, the cause was that my colleague's code created a new sampler connection each run

    1
    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post