-
1. Re: Too many open File Descriptors when using XMLItemReader
cfang Nov 18, 2016 11:18 AM (in response to krzysztofwach)xmlItemReader uses jackson-dataformat-xml for parsing. The reader's close() method closes the jackson xml parser:
jsr352/XmlItemReader.java at master · jberet/jsr352 · GitHub
but jackson xml parser may think the caller owns the stream and so chooses not to close the underlying stream.
I've just created the following JBeret issue:
Too many open File Descriptors when using XMLItemReader
-
2. Re: Too many open File Descriptors when using XMLItemReader
cfang Nov 18, 2016 8:24 PM (in response to cfang)What's your setup (OS and Java versions, Jackson version? etc)? What's the output that shows file descriptors not released (e.g., lsof output)?
I tried my test but couldn't reproduce the problem (with Java 7, jackson-dataformat-xml:jar:2.5.4, jberet-support:jar:1.3.0.Beta4-SNAPSHOT).
xmlItemReader has not changed since jberet-support 1.2.0.Final.
I set a breakpoint at the line before fromXmlParser.close:
public void close() throws Exception {
if (fromXmlParser != null) {
SupportLogger.LOGGER.closingResource(resource, this.getClass());
fromXmlParser.close();
fromXmlParser = null;
}
}
lsof shows the open file of movies-2012.xml.
java 27885 cfang 152r REG 1,7 12833 16410439 /Users/cfang/dev/jsr352/jberet-support/target/test-classes/movies-2012.xml
And once the debugger got past fromXmlParser.close() calls, lsof no longers shows movies-2012.xml file, which means the input resource has been closed.