Hi,
I think I am experiencing a race condition that occurs in geoserver when
creating a layer group with a layer.
I am using geoserver 2.8.1.
I am using geoserver java libraries in the following way:
===
Workspace defaultWorkspace = ...;
if (null == defaultWorkspace)
{
// throw exception
}
// First define the coverage store and coverage:
CoverageStore coverageStore = new CoverageStore();
coverageStore.setName("Coverage_1");
coverageStore.setIsEnable(true);
coverageStore.setresourceURL(<path>);
coverageStore.setWorkspace(defaultWorkspace);
Coverage coverage = new Coverage();
coverage.setCoverageStore(coverageStore );
coverage.setIsEnabled(true);
coverage.setName("Coverage_1");
// Secondly, define the layer group
LayerGroup layerGroup = new LayerGroup();
layerGroup.setName("LayerGroup_1");
layerGroup.setLayers( new HasSet<Layer>());
layerGroup.getLayers().add(coverage);
// Send the REST request
=== end of the code
In geoserver log file, I can see cases where the layer group is created
fine, and some cases where the layer group is not created because the layer
creation is not complete.
*Case 1: layer group is created fine*
2017-02-15 12:03:46,044 DEBUG [gwc.layer] - Handling add event:
LayerInfoImpl[Coverage_1, resource:CoverageInfoImpl[Coverage_1]]
2017-02-15 12:03:46,045 DEBUG [gwc.layer] - Depersisting
GeoServerTileLayerInfo from
*/rt/geoserver/data_dir/gwc-layers/LayerInfoImpl--31e45cbf_15a015a8466_-2f49.xml.tmp
*
2017-02-15 12:03:46,046 DEBUG [gwc.layer] - Depersisting
GeoServerTileLayerInfo from
*/rt/geoserver/data_dir/gwc-layers/LayerInfoImpl--31e45cbf_15a015a8466_-2f49.xml*
2017-02-15 12:03:46,051 DEBUG [jdbc.JDBCQuotaStore] - Creating tileset
TileSet[ohs:Coverage_1#EPSG:900913#image/jpeg]
2017-02-15 12:03:46,052 DEBUG [jdbc.JDBCQuotaStore] - Creating tileset
TileSet[ohs:Coverage_1#EPSG:900913#image/png]
2017-02-15 12:03:46,052 DEBUG [jdbc.JDBCQuotaStore] - Creating tileset
TileSet[ohs:Coverage_1#EPSG:4326#image/jpeg]
2017-02-15 12:03:46,052 DEBUG [jdbc.JDBCQuotaStore] - Creating tileset
TileSet[ohs:Coverage_1#EPSG:4326#image/png]
2017-02-15 12:03:46,053 DEBUG [geoserver.config] - Persisted
com.sun.proxy.$Proxy18 to global.xml
2017-02-15 12:03:46,053 INFO [catalog.rest] - POST coverage
Coverage_1,Coverage_1
2017-02-15 12:03:46,053 DEBUG [org.geoserver] - Thread 52 releasing the lock
in mode WRITE
2017-02-15 12:03:46,053 DEBUG
[filter.GeoServerSecurityContextPersistenceFilter$1] - SecurityContextHolder
now cleared, as request processing completed
2017-02-15 12:03:46,055 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Checking match of
request : 'Path: /rest/layergroups, QueryString: null'; against '/web/**'
2017-02-15 12:03:46,055 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Checking match of
request : 'Path: /rest/layergroups, QueryString: null'; against
'/gwc/rest/web/**'
2017-02-15 12:03:46,055 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Checking match of
request : 'Path: /rest/layergroups, QueryString: null'; against '/'
2017-02-15 12:03:46,055 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Checking match of
request : 'Path: /rest/layergroups, QueryString: null'; against
'/j_spring_security_check'
2017-02-15 12:03:46,055 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Checking match of
request : 'Path: /rest/layergroups, QueryString: null'; against
'/j_spring_security_check/'
2017-02-15 12:03:46,055 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Checking match of
request : 'Path: /rest/layergroups, QueryString: null'; against
'/j_spring_security_logout'
2017-02-15 12:03:46,055 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Checking match of
request : 'Path: /rest/layergroups, QueryString: null'; against
'/j_spring_security_logout/'
2017-02-15 12:03:46,055 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Checking match of
request : 'Path: /rest/layergroups, QueryString: null'; against '/rest/**'
2017-02-15 12:03:46,055 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Matched Path:
/rest/layergroups, QueryString: null with /rest/**
2017-02-15 12:03:46,055 DEBUG [geoserver.security] - AuthenticationCache
found an entry for basic, admin:bfa584f5598433a3c1fe16b00acc9c43
*2017-02-15 12:03:46,055 DEBUG
[security.RESTfulPathBasedFilterInvocationDefinitionMap] - Converted URL to
lowercase, from: '/rest/layergroups'; to: '/rest/layergroups' and
httpMethod= POST*
2017-02-15 12:03:46,055 DEBUG
[security.RESTfulPathBasedFilterInvocationDefinitionMap] - ~~~~~~~~~~
antPath= /** methodList= [GET]
2017-02-15 12:03:46,055 DEBUG
[security.RESTfulPathBasedFilterInvocationDefinitionMap] - Candidate is:
'/rest/layergroups'; antPath is /**; matchedPath=true; matchedMethods=false
2017-02-15 12:03:46,055 DEBUG
[security.RESTfulPathBasedFilterInvocationDefinitionMap] - ~~~~~~~~~~
antPath= /** methodList= [POST, DELETE, PUT]
2017-02-15 12:03:46,055 DEBUG
[security.RESTfulPathBasedFilterInvocationDefinitionMap] - Candidate is:
'/rest/layergroups'; antPath is /**; matchedPath=true; matchedMethods=true
2017-02-15 12:03:46,055 DEBUG
[security.RESTfulPathBasedFilterInvocationDefinitionMap] - returning ADMIN
2017-02-15 12:03:46,055 DEBUG [org.geoserver] - Thread 52 locking in mode
WRITE
2017-02-15 12:03:46,055 DEBUG [org.geoserver] - Thread 52 got the lock in
mode WRITE
2017-02-15 12:03:46,059 INFO [catalog.rest] - to workspace null
2017-02-15 12:03:46,059 DEBUG [catalog.rest] - Auto calculating layer group
bounds
2017-02-15 12:03:46,059 DEBUG [geoserver.config] - Persisting layer group
LayerGroup_1
2017-02-15 12:03:46,071 DEBUG [geoserver.config] - Persisted
com.sun.proxy.$Proxy15 to layergroups/LayerGroup_1.xml
2017-02-15 12:03:46,071 DEBUG [gwc.layer] - Depersisting
GeoServerTileLayerInfo from
*/rt/geoserver/data_dir/gwc-layers/LayerGroupInfoImpl--31e45cbf_15a015a8466_-2f48.xml.tmp*
2017-02-15 12:03:46,072 DEBUG [gwc.layer] - Depersisting
GeoServerTileLayerInfo from
*/rt/geoserver/data_dir/gwc-layers/LayerGroupInfoImpl--31e45cbf_15a015a8466_-2f48.xml*
*Case 2: layer creation is not complete and layer group creation fails
silently*
2017-02-14 14:41:56,288 DEBUG [gwc.layer] - Handling add event:
LayerInfoImpl[Coverage_2, resource:CoverageInfoImpl[Coverage_2]]
2017-02-14 14:41:56,288 DEBUG [gwc.layer] - Depersisting
GeoServerTileLayerInfo from
*/rt/geoserver/data_dir/gwc-layers/LayerInfoImpl--31e45cbf_15a015a8466_-2f8f.xml.tmp*
2017-02-14 14:41:57,441 DEBUG [diskquota.CacheCleanerTask] - Global cache
quota enforcement task still running, avoiding issueing a new one...
2017-02-14 14:42:01,261 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Checking match of
request : 'Path: /rest/layergroups/LayerGroup_2.xml, QueryString: null';
against '/web/**'
2017-02-14 14:42:01,261 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Checking match of
request : 'Path: /rest/layergroups/LayerGroup_2.xml, QueryString: null';
against '/gwc/rest/web/**'
2017-02-14 14:42:01,261 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Checking match of
request : 'Path: /rest/layergroups/LayerGroup_2.xml, QueryString: null';
against '/'
2017-02-14 14:42:01,261 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Checking match of
request : 'Path: /rest/layergroups/LayerGroup_2.xml, QueryString: null';
against '/j_spring_security_check'
2017-02-14 14:42:01,261 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Checking match of
request : 'Path: /rest/layergroups/LayerGroup_2.xml, QueryString: null';
against '/j_spring_security_check/'
2017-02-14 14:42:01,261 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Checking match of
request : 'Path: /rest/layergroups/LayerGroup_2.xml, QueryString: null';
against '/j_spring_security_logout'
2017-02-14 14:42:01,261 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Checking match of
request : 'Path: /rest/layergroups/LayerGroup_2.xml, QueryString: null';
against '/j_spring_security_logout/'
2017-02-14 14:42:01,261 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Checking match of
request : 'Path: /rest/layergroups/LayerGroup_2.xml, QueryString: null';
against '/rest/**'
2017-02-14 14:42:01,261 DEBUG
[security.IncludeQueryStringAntPathRequestMatcher] - Matched Path:
/rest/layergroups/LayerGroup_2.xml, QueryString: null with /rest/**
2017-02-14 14:42:01,261 DEBUG [geoserver.security] - AuthenticationCache
found an entry for basic, admin:bfa584f5598433a3c1fe16b00acc9c43
*2017-02-14 14:42:01,261 DEBUG
[security.RESTfulPathBasedFilterInvocationDefinitionMap] - Converted URL to
lowercase, from: '/rest/layergroups/LayerGroup_2.xml'; to:
'/rest/layergroups/LayerGroup_2.xml' and httpMethod= GET*
2017-02-14 14:42:01,261 DEBUG
[security.RESTfulPathBasedFilterInvocationDefinitionMap] - ~~~~~~~~~~
antPath= /** methodList= [GET]
2017-02-14 14:42:01,261 DEBUG
[security.RESTfulPathBasedFilterInvocationDefinitionMap] - Candidate is:
'/rest/layergroups/LayerGroup_2.xml'; antPath is /**; matchedPath=true;
matchedMethods=true
2017-02-14 14:42:01,261 DEBUG
[security.RESTfulPathBasedFilterInvocationDefinitionMap] - returning ADMIN
2017-02-14 14:42:01,262 DEBUG [org.geoserver] - Thread 18 locking in mode
READ
2017-02-14 14:42:07,441 DEBUG [diskquota.CacheCleanerTask] - Global cache
quota enforcement task still running, avoiding issueing a new one...
2017-02-14 14:42:07,879 DEBUG [gwc.layer] - Depersisting
GeoServerTileLayerInfo from
*/rt/geoserver/data_dir/gwc-layers/LayerInfoImpl--31e45cbf_15a015a8466_-2f8f.xml*
2017-02-14 14:42:07,879 DEBUG [diskquota.CacheCleaner] - Expiring tile page
TilePage[WV_3622#EPSG:4326#image/png@18,1,12] based on the global LFU
expiration policy
2017-02-14 14:42:07,889 INFO [file.FileBlobStore] - Truncated 1 tiles
2017-02-14 14:42:07,889 DEBUG [seed.TruncateTask] - Completed truncate
request.
2017-02-14 14:42:07,889 INFO [seed.GWCTask] - Thread group finished TRUNCATE
task after 0.01 seconds
2017-02-14 14:42:07,889 INFO [jdbc.JDBCQuotaStore] - Truncating page
TilePage[WV_3622#EPSG:4326#image/png@18,1,12]
2017-02-14 14:42:07,889 INFO [jdbc.JDBCQuotaStore] - Setting page
TilePage[WV_3622#EPSG:4326#image/png@18,1,12] fill factor to 0.0
2017-02-14 14:42:07,892 DEBUG [jdbc.JDBCQuotaStore] - Creating tileset
TileSet[ohs:Coverage_2#EPSG:4326#image/png]
2017-02-14 14:42:07,892 DEBUG [jdbc.JDBCQuotaStore] - Creating tileset
TileSet[ohs:Coverage_2#EPSG:4326#image/jpeg]
2017-02-14 14:42:07,892 DEBUG [jdbc.JDBCQuotaStore] - Creating tileset
TileSet[ohs:Coverage_2#EPSG:900913#image/jpeg]
2017-02-14 14:42:07,892 DEBUG [jdbc.JDBCQuotaStore] - Creating tileset
TileSet[ohs:Coverage_2#EPSG:900913#image/png]
2017-02-14 14:42:07,892 INFO [jdbc.JDBCQuotaStore] - Applying quota diff
-176128 on tileset TileSet[WV_3622#EPSG:4326#image/png]
2017-02-14 14:42:07,892 INFO [jdbc.JDBCQuotaStore] - Applying page stats
payload PageStatsPayload [numTiles=-1, lastAccessTime=0, numHits=0,
page=TilePage[WV_3622#EPSG:4326#image/png@16,3,12], tileSet=null]
2017-02-14 14:42:07,893 DEBUG [geoserver.config] - Persisted
com.sun.proxy.$Proxy18 to global.xml
2017-02-14 14:42:07,893 INFO [catalog.rest] - POST coverage
Coverage_2,Coverage_2
Is this a bug in geoserver? Is it some configuration mistake?
Thanks,
Jessica
--
View this message in context:
http://osgeo-org.1560.x6.nabble.com/Race-condition-when-creating-a-layer-and-a-layer-group-together-tp5308287.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users