[ 
https://issues.apache.org/jira/browse/SOLR-10338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16415793#comment-16415793
 ] 

David Smiley commented on SOLR-10338:
-------------------------------------

Sorry for ambiguity but the "this" I refer to is the following assertion:
{code:java}
    assertFalse("SecureRandom algorithm '" + algorithm + "' is in use by your 
JVM, " +
                "which is a potentially blocking algorithm on some 
environments. " +
                "Please report the details of this failure (and your JVM 
vendor/version) to [email protected]. " +
                "You can try to run your tests with -D"+EGD+"="+URANDOM+" or 
bypass this check using " +
                "-Dtest.solr.allowed.securerandom="+ algorithm +" as a JVM 
option when running tests.",
                // be permissive in our checks and blacklist only algorithms 
                // that are known to be blocking under some circumstances
                algorithm.equals("NativePRNG") || 
algorithm.equals("NativePRNGBlocking"));
{code}

Please hear me out one one point:

bq. the changes made SOLR-10338 do not involve SolrTestCaseJ4 do not involve 
anything that should "randomly occur" ... any assertion from the code committed 
in this issue should occur reliably 100% of the time assuming they are re-run 
on the same JVM.

I can imagine this may come as a surprise but I can reliably reproduce a 
situation in which this Assertion gets thrown randomly -- thus your claim is 
false. I've dug into the root cause.  The first use of SecureRandom in the JVM 
is the only time at which the {{java.security.egd}} system property is 
considered.  {{SolrTestCaseJ4.assertNonBlockingRandomGeneratorAvailable}} will 
set this property.  Nothing new here; anyone reading this thread knows that.  
But Solr won't necessarily be able to do this first.  For example, if there are 
other tests that don't extend SolrTestCaseJ4 that use SecureRandom then this 
won't happen.  And the order of test execution can be randomized.  Note that 
SecureRandom is used for, of all things, creating a temp file in Java, and lots 
of code directly or indirectly will do that -- especially in tests.

> Configure SecureRandom non blocking for tests.
> ----------------------------------------------
>
>                 Key: SOLR-10338
>                 URL: https://issues.apache.org/jira/browse/SOLR-10338
>             Project: Solr
>          Issue Type: Sub-task
>            Reporter: Mihaly Toth
>            Assignee: Mark Miller
>            Priority: Major
>             Fix For: 7.1, master (8.0)
>
>         Attachments: SOLR-10338.patch, SOLR-10338.patch, SOLR-10338.patch, 
> SOLR-10338.patch, SOLR-10338.patch, SOLR-10338.patch, SOLR-10338.patch, 
> SOLR-10338.patch
>
>
> It would be best if SecureRandom could be made non blocking. In that case we 
> could get rid of random entropy exhaustion issue related to all usages of 
> SecureRandom.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to