-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to access Ultradict after a certain loop Limit, Issue occurs Only on Linux............. #9
Comments
Hi @hemakumar01 Thanks for your issue report. Can you please try the dev branch and see if this fixes your issue? |
PS: To add some explanation: With your code, you're creating and connecting 5000 new instances of an UltraDict to shared memory. There is a bug in the main branch that prevents proper cleanup of all file handles and at some point some of the OS resources are gone and you will start seeing random exceptions. Though, of course using UltraDict like this is not really an efficient way. You should keep around your instances (unless you also spawn 5000 new processes in the same time). |
I tried the dev branch and the issue is now fixed, Thanks for the reply, out of curiosity, i didnt look into the dev code much, can you explain what was done to fix the issue. |
Sure, I've moved the cleanup code from an atexit handler to a finalizer and also implemented the |
from UltraDict import UltraDict
ultra = UltraDict({ 'init': 'some initial data' }, name='myname1')
for i in range(1,5000):
print(UltraDict(name='myname1'))
############### ERROR #################
File "/home/merit/miniconda3/lib/python3.9/site-packages/UltraDict/UltraDict.py", line 659, in unlink
self.control.unlink()
File "/home/merit/miniconda3/lib/python3.9/multiprocessing/shared_memory.py", line 241, in unlink
_posixshmem.shm_unlink(self._name)
FileNotFoundError: [Errno 2] No such file or directory: '/myname1'
The text was updated successfully, but these errors were encountered: