Skip to content

HTTP connections are not returned to the pool in GWC and it blocks subsequent requests.. #1308

Description

@vitalus

GeoServer closes WMS service API with HTTP Basic authentication.

GWC sends internal request to WMS without credentials (if they are not configured) and also is not able to authenticate against WMS service..

WMSHttpHelper.connectAndCheckHeaders throws Service Exception (because WMS service responds with 401):

	        if (responseCode != 200 && responseCode != 204) {
	            tileRespRecv.setError();
	            throw new ServiceException(
	                    "Unexpected response code from backend: "
	                            + responseCode
	                            + " for "
	                            + wmsBackendUrl.toString());
	        }

So, in this workflow an allocated (from the pool) HTTP connection is never released back to the pool.
By default 2 connections are per HTTP route (is is also questionable, shouldn't we allow more for internal GWC-WMS communication?)

So, connections are taken from the pool and never returned. All subsequent connections will wait pool without timeout.. (timeone is alos needed for internal connections).

AN easy fix is to put all content of connectAndCheckHeaders into try{}finally{}:

Something like this (tried quickly and locking problem is gone at least, regardless workflow connection is returned to the pool):

image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions