Hi Vidar, Wow ! You are in fact right. The RhinoJavaScriptEngine.eval() method never closes the reader it receives. Neither does the DefaultSlingScript generating the original reader.
IMHO this is clearly a bug in the DefaultSlingScript method, which should ensure closing the reader created to call the ScriptEngine.eval() method - I don't think this should be done by the eval method itself because I think methods getting a reader (or writer) should never close it and leave this to the caller. Thanks for discovering.... I created issue https://issues.apache.org/jira/browse/SLING-380 for this Regards Felix Am Dienstag, den 15.04.2008, 10:51 +0200 schrieb Vidar Ramdal: > On Tue, Apr 15, 2008 at 10:11 AM, Bertrand Delacretaz > <[EMAIL PROTECTED]> wrote: > > On Tue, Apr 15, 2008 at 10:03 AM, Vidar Ramdal <[EMAIL PROTECTED]> wrote: > > > ... OK, I get just about 850 rows of this: > > > > > java 31685 root 175r REG 104,1 16 829481 > > > > > > > > /usr/local/resin-3.1.1/sling/jackrabbit/workspaces/default/blobs/dc/8e/9c1ccf814774bb9c44ba49453cdc/%7bhttp%3a%2f%2fwww.jcp.org%2fjcr%2f1.0%7ddata.0.bin > > > > > > So it's something from the repository that is being opened and not > > closed?... > > > > Yes, does that filename map to something that you're manipulating in > > your Sling test? Maybe Sling is not closing something properly, if you > > could find out exactly which part of your test code uses that file > > that would help. > > I'm not sure how I could identify what JCR content is contained in > that particular file. But, as it is within the "blobs" directory, I > would guess it contains a file that I've uploaded. > My test code shouldn't be using any JCR content except for the simple > rendering script in my first message, which is a .esp file. > > I've done some investigating in the Sling source code, based on the > stacktrace. > RhinoJavaScriptEngine lines 63-65: > if (scriptName.endsWith(RhinoJavaScriptEngineFactory.ESP_SCRIPT_EXTENSION)) { > scriptReader = new EspReader(scriptReader); > } > > EspReader has a close() method, but RhinoJavaScriptEngine never calls > scriptReader.close(). > Could this be the culprit? > >
