You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Eric Pugh (Jira)" <ji...@apache.org> on 2022/10/14 20:07:00 UTC
[jira] [Commented] (SOLR-10712) UpdateRequest.setDocIterator() writes the payload in memory before sending to server
[ https://issues.apache.org/jira/browse/SOLR-10712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17617952#comment-17617952 ]
Eric Pugh commented on SOLR-10712:
----------------------------------
[~noble.paul] has this issue been overcome by events and is now closable?
I looked at UpdateRequest, and the setDocIterator looks like what I would expect:
{{public void setDocIterator(Iterator<SolrInputDocument> docIterator) {}}
{{{}this.docIterator = docIterator;{}}}{{{}}{}}}
> 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
> Components: SolrJ
> Reporter: Noble Paul
> Priority: Major
>
> {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
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org