Github user ijokarumawak commented on the issue:

    https://github.com/apache/nifi/pull/1579
  
    @alopresto LGTM +1. Thanks for fixing this!
    
    Please merge if my test result is sufficient.
    
    ## Confirmed that I can reproduce the issue
    
    I had been using a workaround by mapping hosts `/dev/urandom` to Docker 
containers `/dev/random` before. To confirm the issue happens, I removed that 
workaround and started 7 NiFi containers using docker-compose.
    
    Without the workaround, NiFi start-up was blocked exactly the same point as 
expected, and here is the stacktrace of main method:
    
    ```
    Without workaround main thread blocks here:
    "main" Id=1 RUNNABLE  (in native code)
            at java.io.FileInputStream.readBytes(Native Method)
            at java.io.FileInputStream.read(FileInputStream.java:255)
            at 
sun.security.provider.SeedGenerator$URLSeedGenerator.getSeedBytes(SeedGenerator.java:539)
            at 
sun.security.provider.SeedGenerator.generateSeed(SeedGenerator.java:144)
            at 
sun.security.provider.SecureRandom$SeederHolder.<clinit>(SecureRandom.java:203)
            at 
sun.security.provider.SecureRandom.engineNextBytes(SecureRandom.java:221)
            - waiting on sun.security.provider.SecureRandom@39c08111
            at java.security.SecureRandom.nextBytes(SecureRandom.java:468)
            - waiting on java.security.SecureRandom@5cc41bea
            at 
org.jasypt.salt.RandomSaltGenerator.generateSalt(RandomSaltGenerator.java:92)
            - waiting on java.security.SecureRandom@5cc41bea
            at 
org.jasypt.encryption.pbe.StandardPBEByteEncryptor.encrypt(StandardPBEByteEncryptor.java:891)
            at 
org.jasypt.encryption.pbe.StandardPBEStringEncryptor.encrypt(StandardPBEStringEncryptor.java:642)
            at 
org.apache.nifi.encrypt.StringEncryptor.encrypt(StringEncryptor.java:130)
            at 
org.apache.nifi.encrypt.StringEncryptor.createEncryptor(StringEncryptor.java:108)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    ```
    
    It took about 10 minutes to start-up. Usually it takes 10 - 15 min without 
workaround in my environment.
    
    ## Confirmed that this PR addresses the issue
    
    After reproducing the issue, I replaced bootstrap.conf in my NiFi container 
image. Then started 7 NiFi containers using docker-compose. Did the same thing 
3 times. The blocking issue didn't happen, and NiFi can startup in about 1-2 
minutes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to