自 SolR 5.x 以来,子实体 SolrEntityProcessor 停止工作

Subentity SolrEntityProcessor stops working since SolR 5.x

我使用这样的数据导入

<dataConfig>
    <document name="products">
        <entity
            name="outer"
            dataSource="my_datasource"
            pk="id"
            query="..."
            deltaQuery="..."
            deltaImportQuery="..."
        >
            <entity
                name="solr"
                processor="SolrEntityProcessor"
                url="http://127.0.0.1:8983/solr/${solr.core.name}"
                query="Xid:${outer.Xid}"
                rows="1"
                fl="Id,FieldA,FieldB"
                wt="javabin"
            />
        </entity>
    </document>
</dataConfig>

有趣的部分是子实体,它使用SolrEntityProcessor。在(包括)SoLR 4.10 之前一切正常,但从 5.1 开始它就不再工作了。它并没有失败,它告诉我,它失败了,但是它 "successfully" 在 second 文档的导入过程中停止了。

在日志中出现以下异常。看起来 DIH 故意 关闭了 SolrEntityProcessor 的连接,并在它试图获取第二个文档的子实体时立即崩溃。

java.lang.RuntimeException: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: java.lang.IllegalStateException: Connection pool shut down
    at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:270)
    at org.apache.solr.handler.dataimport.DataImporter.doDeltaImport(DataImporter.java:444)
    at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:482)
    at org.apache.solr.handler.dataimport.DataImporter.run(DataImporter.java:461)
Caused by: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: java.lang.IllegalStateException: Connection pool shut down
    at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:416)
    at org.apache.solr.handler.dataimport.DocBuilder.doDelta(DocBuilder.java:363)
    at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:224)
    ... 3 more
Caused by: org.apache.solr.handler.dataimport.DataImportHandlerException: java.lang.IllegalStateException: Connection pool shut down
    at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:62)
    at org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(EntityProcessorWrapper.java:246)
    at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:475)
    at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:514)
    at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:414)
    ... 5 more
Caused by: java.lang.IllegalStateException: Connection pool shut down
    at org.apache.http.util.Asserts.check(Asserts.java:34)
    at org.apache.http.pool.AbstractConnPool.lease(AbstractConnPool.java:184)
    at org.apache.http.pool.AbstractConnPool.lease(AbstractConnPool.java:217)
    at org.apache.http.impl.conn.PoolingClientConnectionManager.requestConnection(PoolingClientConnectionManager.java:184)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415)
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:466)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:235)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:227)
    at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:135)
    at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:943)
    at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:958)
    at org.apache.solr.handler.dataimport.SolrEntityProcessor.doQuery(SolrEntityProcessor.java:198)
    at org.apache.solr.handler.dataimport.SolrEntityProcessor.buildIterator(SolrEntityProcessor.java:147)
    at org.apache.solr.handler.dataimport.SolrEntityProcessor.nextRow(SolrEntityProcessor.java:128)
    at org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(EntityProcessorWrapper.java:243)
    ... 8 more

这是 Solr 中的一个已知错误。连我都遇到过!我将此作为答案发布是因为,这是一个 bug 并且作者 no solution!我们实际上已经降级了版本以摆脱这个错误。我不确定这是否有帮助,但这是我们最后所做的。

更新:这可能对您有帮助,也可能没有帮助,但我们通过降级解决了这个问题。