Bug #4075
closed<xsl:for-each saxon:threads="8"> fails with RejectedExecutionException
100%
Description
I added saxon:threads="8" to a working stylesheet and it ran successfully for a while, then failed with a RejectedExecutionException
, indicating that the ExecutorService is saturated. We should recover from this.
Updated by Michael Kay over 5 years ago
- Status changed from New to Resolved
- Fix Committed on Branch 9.9 added
Although I'm not 100% confident I know what's going on, I've added code to recover from a RejectedExecutionException by waiting and trying again, a maximum of 10 times, with wait times increasing by successive doubling from 1ms to 1s. Patch to MultithreadedContextMappingIterator.
Updated by O'Neil Delpratt about 5 years ago
- % Done changed from 0 to 100
- Fixed in Maintenance Release 9.9.1.1 added
Bug fix applied to the Saxon 9.9.1.1 maintenance release.
Updated by O'Neil Delpratt about 5 years ago
- Status changed from Resolved to Closed
Updated by Michael Kay about 5 years ago
- Status changed from Closed to In Progress
I'm going to re-open this because I'm not convinced the current patch is a complete solution. Running the XX compiler in multi-threaded mode, I've seen this error occur even after applying the patch.
Updated by Michael Kay about 5 years ago
- Status changed from In Progress to Closed
- Applies to branch trunk added
- Fix Committed on Branch trunk added
I have not been able to reproduce the problem, so I am closing with no further action.
Note, for future reference however: the patch in MultithreadedContextMappingIterator
may also be needed in other places such as MultithreadedItemMappingIterator
. Note also that for xsl:result-document
, we deal with the RejectedExecution
problem a different way: rather than catching the exception, the code in ThreadManagerEE.java
does
if (executorService instanceof ThreadPoolExecutor) {
((ThreadPoolExecutor) executorService).setRejectedExecutionHandler(
new ThreadPoolExecutor.CallerRunsPolicy());
}
Please register to edit this issue