>From: Neil Schemenauer>To: Austine Jane >CC: durus-users@mems-exchange.org >Subject: Re: [Durus-users] FileStorage bug? >Date: Fri, 15 Oct 2004 10:02:25 -0400 > >On Fri, Oct 15, 2004 at 08:51:07PM +0900, Austine Jane wrote: > > Since there is no __del__ in FileStorage, it depends on python's > > ability to "del"ing all the remaining objects when it's closing > > the vm -- it doesn't explictly call "close" method in FileStorage. > >I'm pretty sure adding __del__ will not help. It will only be >called when the FileStorage instance is freed. If that happens the >file object that it refers to should also be closed. > > > However, when running durus with quixote on top of twisted server and I > > send SIGINT(via ctrl-c), there seems to be a problem. Restarting and > > terminating the application with SIGINT a couple of times, I encounter > > short read IOError. > >Can you provide a traceback? Also, are you using FileStorage >directly or are you using a storage server? > > > At first, I though Durus was too fragile to use in a serious >environment. > > To solve the problem, I used "atexit" in order to call the close method >on > > connection.storage explicitly just before the shut down. Now I don't see > > short read error any more (so far). > >That's probably the best solution. > > Neil First of all, thank you for your quick reply. However, the problem does not seem to be in closing the storage. I am using PersistentList to hold instances of a subclass of Persistent. The instance of PersistentList is attached as an item in root dictionary. Whether I am using FileStorage or ClientStorage, the system breaks when there are more than a dozen of items in the PersistentList. Following tracebacks were made when I put in about twenty items in the list and stopped the client and restarted the client(the durus server was still running) to put another item. The error is reproducible and it happens always. traceback 1: Traceback (most recent call last): File "c:\python23\Lib\site-packages\quixote\publish.py", line 522, in process_request output = self.try_publish(request, env.get('PATH_INFO', '')) File "c:\python23\Lib\site-packages\quixote\publish.py", line 457, in try_publish output = object(request) [snip] File "C:\PYTHON23\lib\site-packages\durus\file_storage.py", line 108, in __init__ self._build_index() File "C:\PYTHON23\lib\site-packages\durus\file_storage.py", line 130, in _build_index trecord = readn(self.fp, size) File "C:\PYTHON23\lib\site-packages\durus\file_storage.py", line 16, in readn s = fp.read(n) MemoryError traceback 2: Traceback (most recent call last): File "c:\python23\Lib\site-packages\quixote\publish.py", line 522, in process_request output = self.try_publish(request, env.get('PATH_INFO', '')) File "c:\python23\Lib\site-packages\quixote\publish.py", line 457, in try_publish output = object(request) [snip] File "C:\PYTHON23\lib\site-packages\durus\persistent.py", line 124, in _p_load_state self._p_connection.load_state(self) File "C:\PYTHON23\lib\site-packages\durus\connection.py", line 154, in load_state state = self.reader.get_state(pickle) File "C:\PYTHON23\lib\site-packages\durus\serialize.py", line 151, in get_state state = unpickler.load() EOFError _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/