Resource leak in PropertyFeatureSource breaks the build on Windows
------------------------------------------------------------------

                 Key: GEOT-3290
                 URL: http://jira.codehaus.org/browse/GEOT-3290
             Project: GeoTools
          Issue Type: Bug
          Components: data property
    Affects Versions: 2.6.6, 2.7-M4
            Reporter: Ben Caradoc-Davies
            Priority: Blocker
         Attachments: PropertyFeatureSource.patch

Attached patch fixes a resource leak in PropertyFeatureSource that breaks the 
build on Windows. The problem is the getCount method that fails to dispose a 
reader. When the test fixture is torn down, Windows refuses to let the file be 
deleted as it is still open.

This is unrelated to GEOT-3273.

{code}
-------- Original Message --------
Subject: Re: [Geotools-devel] [ExternalEmail] Re: Build Failure: 
AppSchemaFileDataTest gives    errors
Date: Tue, 12 Oct 2010 09:56:31 +0800
From: Ben Caradoc-Davies 
CC: Tara Athan , "Tan, Florence (CESRE, Kensington)", 
"[email protected]"

Florence is also reporting this failure. Is anyone else seeing it on
Windows? Is it repeatable?

Maybe this is caused by the datastore resource leak:
http://jira.codehaus.org/browse/GEOT-3273

Even though the app-schema DataAccess is properly disposed, it does not
dispose the underlying simple feature data store, which then keeps the
property file open until it is garbage-collected.

Windows differs from other platforms that it does not let an application
delete an open file. This causes the tearDown in the test to fail. On
Unix platforms, file deletion is just unlinking, so this problem is not
evident (the file is only removed when it has no links and nothing has
it open).

On 04/10/10 13:30, Ben Caradoc-Davies wrote:
> That is really weird. It looks like the sort of failures you get on
> Windows when something else has the file open. Can you please manually
> delete the file (mvnn clean would be good) and make sure nothing else
> has it open? Might be TortoiseSVN or even a virus scanner. Because this
> is a temporary directory, I would not expect you to have it open in Eclipse.
>
> Regards,
> Ben.
>
>
> On 04/10/10 12:49, Tara Athan wrote:
>> Ben- regarding your question as to test failures: I'll reply separately
>> for the geotools and geoserver failures on the appropriate lists.
>> Ironically, it is my AppSchemaFileDataTest that is giving errors. Here
>> is the sure-fire report
>>
>> -------------------------------------------------------------------------------
>> Test set: org.geotools.data.complex.config.AppSchemaFileDataTest
>> -------------------------------------------------------------------------------
>> Tests run: 4, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 2.406
>> sec<<<   FAILURE!
>> testPropertiesMappings(org.geotools.data.complex.config.AppSchemaFileDataTest)
>> Time elapsed: 1 sec<<<   ERROR!
>> java.io.IOException: Unable to delete file:
>> target\test\AppSchemaFileDataTest\directory\PointFeatureGeomPropertyfile.properties
{code}


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to