Hey Christoph, Could you give the patch at https://issues.apache.org/jira/browse/SOLR-1744 a try and let me know how it works out for you?
-- - Mark http://www.lucidimagination.com Mark Miller wrote: > Christoph Brill wrote: > >> I tried to fix it in CommonsHttpSolrServer but I wasn't sure how to do >> it. I tried to close the stream after the method got executed, but >> somehow getContent() always returned null (see attached patch against >> solr 1.4 for my non-working attempt). >> >> Who's responsible for closing a stream? CommonsHttpSolrServer? The >> caller? FileStream? I'm unsure because I don't know solrj in depth. >> >> Regards, >> Chris >> >> Am 02.02.2010 14:37, schrieb Mark Miller: >> >> >>> Broken by design? >>> >>> How about we just fix BinaryUpdateRequestHandler (and possibly >>> CommonsHttpSolrServer) to close the stream it gets? >>> >>> >> >> > That class is a little messy for following - but I'd try just assigning > the stream to a local stream thats available through the whole method, > and then at the very bottom finally block, if stream != null, close it. > I think we also want to close it if the exception that causes a retry > happens: > > catch( NoHttpResponseException r ) { > // This is generally safe to retry on > method.releaseConnection(); > method = null; > // If out of tries then just rethrow (as normal error). > if( ( tries < 1 ) ) { > throw r; > } > //log.warn( "Caught: " + r + ". Retrying..." ); > } > >