Geoserver/GeoWebCache (Built In) GridSubset Extent Saves Incorrectly

Description

We have a very strange problem occurring with GeoServers Built in administration interface when dealing with GWC layer configuration. It seems when saving a layer cache configuration from the GeoServer admin, the resulting GWC layer configuration XML generates vastly different results (seemingly arbitrarily) under the <gridSubsets> tag. We've tested this on the two most recent versions of Geoserver (2.11.1 and 2.12.0) and both give the same results.

All examples below use only the built in GWC grid sets (so, I don't think it's a grid set configuration problem).

On first turning on GWC caching for a layer, the <gridSubsets> tag populates the default gridsets configured for GWC without any extent information. :

<gridSubset>
<gridSetName>EPSG:900913</gridSetName>
</gridSubset>
Then when going back to the administration interface and modifying the cache settings (say to add/remove parameter filters) the generated XML will sometimes modify the <gridSubsets> area and sometimes not...and when it does modify the XML it frequently populates the extent coords with values inconsistent with the built in gridset extent (900913's extent is +/-20,037,508.34):

<gridSubset>
<gridSetName>EPSG:900913</gridSetName>
<extent>
<coords>
<double>-5314392.490470881</double>
<double>1679982.1474796906</double>
<double>1.8662712631492313E7</double>
<double>2.003750834E7</double>
</coords>
</extent>
</gridSubset>
Then other times, after saving the layer through the admin interface the extent is set correctly based on the grid extent:

<gridSubset>
<gridSetName>EPSG:900913</gridSetName>
<extent>
<coords>
<double>-2.003750834E7</double>
<double>-2.003750834E7</double>
<double>2.003750834E7</double>
<double>2.003750834E7</double>
</coords>
</extent>
</gridSubset>
Now, the core issue here is; unless the admin interface decides to populate the correct grid set extent in the layer xml, GWC tiles will fail to render (due to what I am assuming is effectively a bad bounding box/extent). Going in and manually setting the extent to the correct values in the XML and reloading works...until the layer is saved again through the admin interface...which puts us right back into this seemingly arbitrary cycle.

Does anyone have any idea what in the world could be going on here? Seen this behavior before?

UPDATE Also confirmed this is still an issue in 2.12.1. Every time we save a layer change through the UI, it's necessary to hunt down the GWC Layer XML file and confirm the extent didn't go haywire.

Environment

Windows Server 2016 64 bit

Status

Assignee

Unassigned

Reporter

Mike O'Meara

Triage

Fix versions

None

Affects versions

Priority

Medium
Configure