From: Philip J. <pj...@un...> - 2009-09-28 21:32:26
|
On Sep 28, 2009, at 1:29 PM, Tobias Ivarsson wrote: > Ok, I've discussed this with my colleague, and the only solution is > to not use memory mapped IO on Windows. Performance of regular IO > buffers on Windows is (according to his benchmarks) even slightly > better than the memory mapped ones on Windows (oddly enough). > > The next step on this issue is to look at the IO code in Jython > (this is not a part of Jython I've been involved with that much) to > verify that this actually is the problem, and then modify it so that > Jython doesn't use memory mapped IO on Windows. We don't do use mmapped IO. I think this is just ElementTree.parse assuming CPython ref counting and not closing its file handles, combined with the fact that Windows disallows removal of a file when it's in use. Gareth, could you please log a ticket for this on the bug tracker? > > I don't have the time to look deeper into this at the moment, so if > someone else on the dev team has some time over to take a look at > this, that would be great. > > Cheers, > Tobias > > On Mon, Sep 28, 2009 at 8:16 PM, Tobias Ivarsson <th...@gm...> > wrote: > I know there is an issue with file locks being retained after files > are closed on Windows: > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4715154 > > And I think the features that trigger this bug are used in Jython. > The symptoms described here are exactly the ones I've seen with this > issue before. > > I know a guy with excellent knowledge in this area, I'll get back > when I've consulted him on how this can be worked around on the > insides of Jython. Until then your best bet is to use a better > operating system. > > cheers, > Tobias > > On Mon, Sep 28, 2009 at 4:53 PM, DOUTCH GARETH-GDO003 <Gar...@mo... > > wrote: > Hi there, > > I have a problem with an xml file locking after read and/or write. > > I have a short sample code with unit test attached. Below are the > outputs from Jython and CPython (v 2.5.4). Is this a bug? > Can anybody offer an alternative workaround? > > I am using Jython 2.5.1 on Windows XP and java version "1.6.0_16". > > Cheers, > > Gareth > > > >jython lock.py > E > ====================================================================== > ERROR: runTest (__main__.TestDelete) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "W:\testTeam\SIT\JySit\sit\scripts\lock.py", line 73, in > tearDown > os.remove(self.fileName) > File "C:\jython2.5.1\Lib\os.py", line 342, in remove > raise OSError(0, "couldn't delete file", path) > OSError: [Errno 0] couldn't delete file: 'C:\\testdir\\test.xml' > > ---------------------------------------------------------------------- > Ran 1 test in 0.454s > > FAILED (errors=1) > > > >python lock.py > . > ---------------------------------------------------------------------- > Ran 1 test in 0.015s > > OK > -- Philip Jenvey |