[tor-bugs] #13141 [Stem]: Stem : Too many open file error
Tor Bug Tracker & Wiki
blackhole at torproject.org
Fri Sep 12 07:53:21 UTC 2014
#13141: Stem : Too many open file error
-------------------------------------------------+-------------------------
Reporter: RSenet | Owner: atagar
Type: defect | Status: new
Priority: normal | Milestone: Tor:
Component: Stem | unspecified
Keywords: Stem, python, tor, too many open | Version: Tor:
file | unspecified
Parent ID: | Actual Points:
| Points:
-------------------------------------------------+-------------------------
If you launch many connection over Tor using stem and
launch_tor_with_config function, you'll probably have an exception like :
'''OSError: [Errno 24] Too many open files'''
The problem is comming from this line:
'''torrc_path = tempfile.mkstemp(prefix = "torrc-", text = True)[1]'''
This exception is raise because "tempfile.mkstemp" create a file
descriptor which is never closed in '''process.py''' file.
To properly close tempile, you have to use this correction :
'''fileDescriptor, torrc_path = tempfile.mkstemp(prefix = 'torrc-', text =
True)'''
Before delete the temp file, you just have to close the file descriptor:
'''os.close(fileDescriptor)'''
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/13141>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list