[ https://issues.apache.org/jira/browse/SOLR-8808?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jason Gerlowski updated SOLR-8808: ---------------------------------- Attachment: SOLR-8808.patch Uploaded patch contains changes to SolrClient.java. It also adds a simple test to a few SolrClient related test-files that verify the behavior. One aspect of this change that I hadn't thought about when I first saw it is that {{deleteById}} has an UpdateResponse return value. Since this patch changes deleteByid to not send a request when no IDs were given, it's not super clear what the best value to return here is. The patch I uploaded just returns a blank value type created via the no-arg ctor. This means that in practice, a SolrJ user could call deleteById() and get a return value just fine. But if they go to pull out the request timestamp, or the headers later on, they could get bitten by an NPE. So while it looks like this patch is an obvious improvement, it really might just kick the can down the road a bit and lead to errors later on. That said, I still think it's an improvement, and this is the right thing to do. Just wanted to call it out in case anyone has a suggestion for getting around that limitation. > SolrJ deleteById causes missing content stream exception > -------------------------------------------------------- > > Key: SOLR-8808 > URL: https://issues.apache.org/jira/browse/SOLR-8808 > Project: Solr > Issue Type: Bug > Components: SolrJ > Affects Versions: 5.5 > Reporter: Markus Jelsma > Priority: Minor > Fix For: master, 6.1 > > Attachments: SOLR-8808.patch > > > {code} > client.deleteById(new ArrayList<String>()); > {code} > Causes > {code} > org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error > from server at http://127.0.0.1:50083/collection1: Error from server at > http://127.0.0.1:50083/control_collection: missing content stream > at > __randomizedtesting.SeedInfo.seed([6C4973F1A077B797:65D362791DA8A1AD]:0) > at > org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:576) > at > org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:240) > at > org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:229) > at > org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:149) > at org.apache.solr.client.solrj.SolrClient.commit(SolrClient.java:482) > at org.apache.solr.client.solrj.SolrClient.commit(SolrClient.java:463) > {code} > Although this is not a big issue, it had me puzzled for a while. A test > unrelated to one i was working on started sending empty deletes. Causing > above trace. > Perhaps SolrJ should guard for empty input, just ignore and return. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org