[Geoserver-devel] [JIRA] (GEOS-10559) Lazy initialization of GetMapKvpRequestReader's HTTP client used to fetch remote styles

Gabriel Roldan created an issue

GeoServer / ImprovementGEOS-10559

Lazy initialization of GetMapKvpRequestReader’s HTTP client used to fetch remote styles

Issue Type:

ImprovementImprovement

Affects Versions:

2.21.0

Assignee:

Gabriel Roldan

Components:

WMS

Created:

23/Jun/22 8:33 PM

Priority:

MediumMedium

Reporter:

Gabriel Roldan

GetMapKvpRequestReader creates an apache CloseableHttpClient on its constructor.

To do so, it needs to get the stles cache configuration from the org.geoserver.wms.WMS facade.

Depending on the bootstrap conditions, this triggers eager initialization of beans, that can lead to a circular reference error. This issue is observed in GeoServer Cloud.

Also, the eager initialization of the HTTP client can result in a waste of resources, because it may never use it, and because there are subclasses that definitely won’t use it.

Some of these subclasses are not spring beans, but created on-demand, such as WMSRequests.LayerParser, which currently adds a CatalogListener on each invocation of WMSRequests.getGetMapParams(), that is never removed from the catalog, hence being a memory leak.

As a solution, the HTTP client used by GetMapKvpRequestReader shall be lazily initialized.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100201-sha1:92d0e2d)

Atlassian logo