BTW: i'll try to look at the newsest version of hte patch tonight.

: >  - What should the expectations of
: >    ContentStream.getInputStream().close() be? Should the Dispatcher
: >    iterate over any Iterable streams when writing the output and try
: >    to close them, ignoring any Exceptions?
:
: Each handler is responsible to make sure they are closed.  Since it is
: an Iterable<ContentStream> - I don't think it is OK to iterate a
: *second* time.  If we make it a Collection<> then that would be a
: reasonable behavior.

my thinking was that the javadocs for SolrQueryRequest should say that if
a RequestHandler iterates over the ContentStreams, it is responsible for
closing all of them, but in case the RequestHandler ignores the
ContentStreams altogether the Dispatcher should attempt to clean up by
attempting to iterate and close them.

for simple Iterable items (ie; Collections), iterating a second time
shouldn't be a problem ... in more complex Iterables (ie: closures that
can't be reset) the iterator() method should either return null, or an
Iterator whose hasNext() method immediately returns false -- both of which
the Dispatcher can check for and in those cases it won't worry about the
ContentStreams.


-Hoss

Reply via email to