StreamingRenderer change to Java 7 localThreadPool.awaitTermination

Description

Hal Mirsky on the user list.

Hello,

I’ve been experimenting with JLayeredMapPane and believe I’ve uncovered an issue in StreamingRenderer tied to Java 7. I observed LabelCacheImpl.paintLabels throwing InvalidState exceptions and traced it to StreamingRenderer.paint() use of localThreadPool.shutdown() to wait for render processing to complete. In Java 7, shutdown() behavior has changed from Java 6 as follows:
“This method does not wait for previously submitted tasks to complete execution. Use awaitTermination to do that.”

After changing StreamingRenderer.paint() to use awaitTermination instead of shutdown the exceptions do not occur.

I am using geotools 12.2. Here is a snippit from StreamingRenderer.paint() showing the modification I made:

(localPool) {
{
localThreadPool.awaitTermination(100, TimeUnit.MILLISECONDS);
}
(Exception e) {
fireErrorEvent(e);
}
}

This fix seems to be brittle partly because of the timeout value. A rendering ‘hint’ could be used to make the timeout a tunable parameter. Any suggestions?

Hal

Environment

None

Status

Assignee

Unassigned

Reporter

Jody Garnett

Triage

None

Components

Priority

High
Configure