WCS scaleFactor and CRS lookups are not thread-safe

Description

This was originally posted to the geoserver-users mailing list on 12/7/2017 with the subject "Concurrency issues with WCS". No response was received as of time of writing this issue.

Running Geoserver 2.10.4 with a Postgres/PostGIS database.

Configured ImageMosaic extension with a Netcdf store.

I’m seeing errors when multiple requests are being processed for the same CoverageID, and either a scalingFactor is applied or a outputCrs/subsettingCrs is specified. Issues don’t seem related to each other, but they only come up when multiple requests are being handled concurrently.

Sample request parameters (CoverageId removed but it is the same for all requests):

  1. (Good) geoserver/wcs?service=WCS&version=2.0.1&request=GetCoverage&subset=Lat("0","90")&subset=Long("60","150")&format=application/x-netcdf4

  2. (Random scaling error): geoserver/wcs?service=WCS&version=2.0.1&request=GetCoverage&subset=Lat("0","90")&subset=Long("60","150")&format=application/x-netcdf4&scaleFactor=0.4

  3. (Random CRS error): geoserver/wcs?service=WCS&version=2.0.1&request=GetCoverage&subset=Lat("0","90")&subset=Long("60","150")&format=application/x-netcdf4&outputCrs=http://www.opengis.net/def/crs/EPSG/0/4052

My tests involve sending 5 requests at the same time, each with a slightly different subset on Lat/Long. For #1 above, all responses are correct.
For #2 above, sometimes 2/5 return an exceptionreport, sometimes 3/5.
For #3 above, only 1/5 request works, the other 4 return an “invalidCrs” exception report.

Note that all requests return the expected responses only if a single request is sent at a time.

Any help will be appreciated.

scaleFactor causes following exception on most requests:

outputCrs causes following exception on all but 1 request:

Environment

Geoserver 2.10.4
Postgres/Postgis database backend
Redhat 7
Tomcat 8

Status

Assignee

Andrea Aime

Reporter

alberto

Triage

None

Fix versions

Affects versions

2.12.1
2.10.4

Components

Priority

Medium
Configure