Uploaded image for project: 'LLM AI Integration'
  1. LLM AI Integration
  2. LLMAI-217

Opening the chunks list of a collection shuts down the connection to a remote Solr

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • 0.12
    • 0.4
    • None
    • Unknown

    Description

      Problem

      With XWiki configured for a remote Solr (solr.type=remote), opening a collection page, whose chunks list is a Live Data backed by the LLM index core, shuts down the Solr connection of the whole node. Every later indexing, deletion or search of the LLM index fails with Connection Pool shut down until XWiki is restarted: searches return nothing, and new or changed pages are no longer indexed.

      With the embedded Solr nothing happens, which is why it went unnoticed.

      Cause

      LLMIndexChunksEntryStore, the Live Data entry store behind the chunks list, obtains the platform's Solr client with this.solr.getCore("aillm").getClient() inside a try-with-resources block and closes it when the query is done. The platform caches a single client per core for the lifetime of the instance and only closes it at dispose; no platform caller ever closes it. With the embedded Solr the client's close() is a no-op; with a remote Solr the client is an HttpSolrClient whose close() destroys the shared connection pool.

      The same defect in SolrConnector was fixed in 0.10 (commit ff26a75, "SolrConnector must not close the platform's shared Solr client"); the entry store is the one remaining caller that still closes the client. It is the remaining cause of LLMAI-110.

      Fix

      Fetch the client into a local variable and never close it, as SolrConnector does since 0.10.

      Workaround

      On a remote Solr, do not open the chunks list of a collection page, and restart XWiki if the error appears.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ppantiru Paul Pantiru
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: