galaxyproject / ephemeris

Library for managing Galaxy plugins - tools, index data, and workflows.
https://ephemeris.readthedocs.org/
Other
28 stars 38 forks source link

Close files #163

Closed almahmoud closed 3 years ago

almahmoud commented 3 years ago

Ran into this:

Test 'toolshed.g2.bx.psu.edu/repos/iuc/dropletutils/dropletutils/1.2.1+galaxy6-1' failed
Traceback (most recent call last):
  File "/home/ubuntu/tools-venv/lib/python3.6/site-packages/urllib3/connection.py", line 160, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/home/ubuntu/tools-venv/lib/python3.6/site-packages/urllib3/util/connection.py", line 84, in create_connection
    raise err
  File "/home/ubuntu/tools-venv/lib/python3.6/site-packages/urllib3/util/connection.py", line 65, in create_connection
    sock = socket.socket(af, socktype, proto)
  File "/usr/lib/python3.6/socket.py", line 144, in __init__
    _socket.socket.__init__(self, family, type, proto, fileno)
OSError: [Errno 24] Too many open files

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/tools-venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 677, in urlopen
    chunked=chunked,
  File "/home/ubuntu/tools-venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 392, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.6/http/client.py", line 1281, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1327, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1276, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1042, in _send_output
    self.send(msg)
  File "/usr/lib/python3.6/http/client.py", line 980, in send
    self.connect()
  File "/home/ubuntu/tools-venv/lib/python3.6/site-packages/urllib3/connection.py", line 187, in connect
    conn = self._new_conn()
  File "/home/ubuntu/tools-venv/lib/python3.6/site-packages/urllib3/connection.py", line 172, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f9ef414a588>: Failed to establish a new connection: [Errno 24] Too many open files

First just set ulimit -n 4096 which made it last much longer on the second run, but eventually hit the same error again. So I changed all opens to also close the files and am testing with the fork now, hoping this will help.

mvdbeek commented 3 years ago

These are the release scripts, I don't think they would have any effect within ephemeris itself. Are you setting a high thread number with --parallel_tests ?

almahmoud commented 3 years ago

Only 10 parallel tests. And yeh I just did a regex replace of all one-line opens. Should've looked more closely heh