Noble Paul created SOLR-10712:
---------------------------------
Summary: UpdateRequest.setDocIterator() writes the payload in
memory before sending to server
Key: SOLR-10712
URL: https://issues.apache.org/jira/browse/SOLR-10712
Project: Solr
Issue Type: Bug
Security Level: Public (Default Security Level. Issues are Public)
Components: SolrJ
Reporter: Noble Paul
{code}
@Override
public ContentStream getContentStream(final UpdateRequest request) throws
IOException {
final BAOS baos = new BAOS();
new JavaBinUpdateRequestCodec().marshal(request, baos);
return new ContentStream() {
@Override
public String getName() {
return null;
}
@Override
public String getSourceInfo() {
return "javabin";
}
@Override
public String getContentType() {
return "application/javabin";
}
@Override
public Long getSize() // size if we know it, otherwise null
{
return new Long(baos.size());
}
@Override
public InputStream getStream() {
return new ByteArrayInputStream(baos.getbuf(), 0, baos.size());
}
@Override
public Reader getReader() {
throw new RuntimeException("No reader available . this is a
binarystream");
}
};
}
{code}
This writes everything to in memory buffer before writing it to the server.
This can easily cause OOM errors in the client
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]