GeoServer
  1. GeoServer
  2. GEOS-3066

Removing a DataStore from the catalog does not call DataAccess.dispose()

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-beta1
    • Component/s: Wicket UI
    • Labels:
      None
    • Number of attachments :
      0

      Description

      This one I think is critical since it may leave stale connections.
      Basically I don't see DataAccess.dispose() being called from anywhere in the UI logic (remove?) nor in the Catalog/ResoucePool. (dispose( DataStoreInfo info ) exists in ResoucePool but didn't find a reference to it)

      This patch should do the trick imho, but am not so sure:

      ### Eclipse Workspace Patch 1.0
      #P main
      Index: src/main/java/org/geoserver/catalog/ResourcePool.java
      ===================================================================
      --- src/main/java/org/geoserver/catalog/ResourcePool.java	(revision 12454)
      +++ src/main/java/org/geoserver/catalog/ResourcePool.java	(working copy)
      @@ -300,7 +301,8 @@
            * @param info The data store metadata.
            */
           public void clear( DataStoreInfo info ) {
      -        dataStoreCache.remove( info.getName() );
      +        dispose(info);
      +        dataStoreCache.remove( info.getId() );
           }
           
           /**
      

        Activity

        Hide
        Andrea Aime added a comment -

        As far as I can see the datastore cache is a custom map with a method that will dispose of the datastore when the entry is removed.
        See ResourcePool.DataStoreCache.destroyEntry

        Is that method not called?

        Show
        Andrea Aime added a comment - As far as I can see the datastore cache is a custom map with a method that will dispose of the datastore when the entry is removed. See ResourcePool.DataStoreCache.destroyEntry Is that method not called?
        Hide
        Gabriel Roldan added a comment -

        no it is not being called, but the reason is ResourcePool.clear(DataStoreInfo) calls
        {{ dataStoreCache.remove( info.getName() ) }}
        instead of
        {{ dataStoreCache.remove( info.getId() ) }}

        ok to change that and commit?

        Show
        Gabriel Roldan added a comment - no it is not being called, but the reason is ResourcePool.clear(DataStoreInfo) calls {{ dataStoreCache.remove( info.getName() ) }} instead of {{ dataStoreCache.remove( info.getId() ) }} ok to change that and commit?
        Hide
        Andrea Aime added a comment -

        Arg, yes, it is, it's my fault, when I switched the datastore cache from names to ids I missed that one

        Show
        Andrea Aime added a comment - Arg, yes, it is, it's my fault, when I switched the datastore cache from names to ids I missed that one
        Hide
        Gabriel Roldan added a comment -

        fixed at r12460. And added GEOS-3069

        Show
        Gabriel Roldan added a comment - fixed at r12460. And added GEOS-3069

          People

          • Assignee:
            Justin Deoliveira
            Reporter:
            Gabriel Roldan
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: