RawDataPPIO does not close InputStreams it opens

Description

Refer https://github.com/geoserver/geoserver/blob/master/src/extension/wps/wps-core/src/main/java/org/geoserver/wps/ppio/RawDataPPIO.java#L52

@Override
public void encode(Object value, OutputStream os) throws Exception {
RawData rd = (RawData) value;
IOUtils.copy(rd.getInputStream(), os);
}

I don't believe IOUtils.copy closes inputstreams so looks to me like this inputstream will never be closed (it certainly didn't when I debugged into the copy method). Looks like this should be wrapped in a try finally IOUtils.closeQuietly block

Also refer http://osgeo-org.1560.x6.nabble.com/Need-advice-on-managing-resources-for-WPS-in-Geoserver-td5208596.html and in particular the resource leak issues Julian was referring to.

Environment

None

Assignee

Unassigned

Reporter

Craig Jones

Triage

None

Fix versions

Affects versions

Components

Priority

Medium
Configure