Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-14677

DIH doesnt close DataSource when import encounters errors

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 7.5, 9.0
    • 8.7, 9.0
    • None

    Description

      DIH imports don't close DataSource's (which can hold db connections, etc.) in all cases. Specifically, if an import runs into an unexpected error forwarding processed docs to other nodes, it will neglect to close the DataSource's when it finishes.

      This problem goes back to at least 7.5. This is partially mitigated in older versions of some DataSource implementations (e.g. JdbcDataSource) by means of a "finalize" hook which invokes "close()" when the DataSource object is garbage-collected. In practice, this means that resources might be held open longer than necessary but will be closed within a few seconds or minutes by GC. This only helps JdbcDataSource though - all other DataSource impl's risk leaking resources.

      In master/9.0, which requires a minimum of Java 11 and doesn't have the finalize-hook, the connections are never cleaned up when an error is encountered during DIH. DIH will likely be removed for the 9.0 release, but if it isn't this bug should be fixed.

      Attachments

        1. error-solr.log
          51 kB
          Jason Gerlowski
        2. no-error-solr.log
          35 kB
          Jason Gerlowski

        Issue Links

          Activity

            People

              gerlowskija Jason Gerlowski
              gerlowskija Jason Gerlowski
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m