IDEA-FinAI / ToG

This is the official github repo of Think-on-Graph. If you are interested in our work or willing to join our research team in Shenzhen, please feel free to contact us by email (xuchengjin@idea.edu.cn)
348 stars 39 forks source link

[BUG] relating to open too files, and got killed. #4

Closed hanhan981124 closed 9 months ago

hanhan981124 commented 9 months ago

I ran this project without changing the code, and after running for while, it got kill by OS for opening too many files. And I saw that It opened too many sockset connections withouting closing. Running ls -l /proc/25522/fd | wc -l, I see the number is going. Is it the case that some of the codes after making a request, did not close it? The error msg is down below. Traceback (most recent call last): File "/root/autodl-tmp/project/ToG/main_wiki.py", line 56, in File "/root/autodl-tmp/project/ToG/wiki_func.py", line 108, in relation_search_prune File "/root/autodl-tmp/project/ToG/client.py", line 103, in query_all File "/root/autodl-tmp/project/ToG/client.py", line 103, in File "/root/miniconda3/lib/python3.8/concurrent/futures/_base.py", line 444, in result File "/root/miniconda3/lib/python3.8/concurrent/futures/_base.py", line 389, in get_result File "/root/miniconda3/lib/python3.8/concurrent/futures/thread.py", line 57, in run File "/root/autodl-tmp/project/ToG/client.py", line 26, in get_all_relations_of_an_entity File "/root/miniconda3/lib/python3.8/xmlrpc/client.py", line 1109, in call File "/root/miniconda3/lib/python3.8/xmlrpc/client.py", line 1450, in request File "/root/miniconda3/lib/python3.8/xmlrpc/client.py", line 1153, in request File "/root/miniconda3/lib/python3.8/xmlrpc/client.py", line 1165, in single_request File "/root/miniconda3/lib/python3.8/xmlrpc/client.py", line 1278, in send_request File "/root/miniconda3/lib/python3.8/xmlrpc/client.py", line 1308, in send_content File "/root/miniconda3/lib/python3.8/http/client.py", line 1247, in endheaders File "/root/miniconda3/lib/python3.8/http/client.py", line 1007, in _send_output File "/root/miniconda3/lib/python3.8/http/client.py", line 947, in send File "/root/miniconda3/lib/python3.8/http/client.py", line 918, in connect File "/root/miniconda3/lib/python3.8/socket.py", line 787, in create_connection File "/root/miniconda3/lib/python3.8/socket.py", line 918, in getaddrinfo OSError: [Errno 24] Too many open files

SaizhuoWang commented 9 months ago

Hi, thanks for your interest in our work!

The xmlrpc package relies on TCP socket to communicate with the server, and since our server uses chunked data, multiple queries are sent to different server processes simultaneously for the same request, and open this operation may involve lots of file operations (essentially sockets). Trying to fix this issue, you may:

  1. Change the ulimit of your shell to a larger number, which in most cases solves the problem.
  2. Diagnose whether the xmlrpc client is working. To see this, you may hack into our Wikidata client code and try single connections instead, or via some other debugging issues.

Please let us know if this helps with your problem.