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

PublicKeyHandler consumes a lot of entropy during tests

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 7.4, 8.0
    • 9.0
    • None
    • None

    Description

      After the changes in SOLR-12354 to eagerly create a PublicKeyHandler for the CoreContainer, the creation of the underlying RSAKeyPair uses SecureRandom to generate primes. This eats up a lot of system entropy and can slow down tests significantly (I observed it adding 10s to an individual test).

      Similar to what we do for SSL config for tests, we can swap in a non blocking implementation of SecureRandom for the key pair generation to allow multiple tests to run better in parallel. Primality testing with BigInteger is also slow, so I'm not sure how much total speedup we can get here, maybe it's worth checking if there are faster implementations out there in other libraries.

      In production cases, this also blocks creation of all cores. We should only create the Handler if necessary, i.e. if the existing authn/z tell us that they won't support internode requests.

      Attachments

        Issue Links

          Activity

            People

              mdrob Mike Drob
              mdrob Mike Drob
              Votes:
              0 Vote for this issue
              Watchers:
              4 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 - 2h
                  2h