Start of TIBCO executables (Administrator/AppManage/Obfuscate/BWEngine) takes longer time to startup or hangs on some Linux systems.

Start of TIBCO executables (Administrator/AppManage/Obfuscate/BWEngine) takes longer time to startup or hangs on some Linux systems.

book

Article ID: KB0072365

calendar_today

Updated On:

Products Versions
TIBCO Administrator -
Not Applicable -

Description

Description:
On some machines TIBCO executables (Administrator/AppManage/Obfuscate/BWEngine) starts in less than two minutes, on others, in 10 – 30 minutes or results in a hung state. This issue is seen if there is any SSL communication involved . e.g Like Domains are based on files and use LDAPS or Domain are configured with HTTPS. The same behavior is observed with AppManage and Obfuscate utilities in TRA. No error or exception is recorded in the log file. 
Symptoms:
Sometimes TIBCO executables(Administrator/AppManage/Obfuscate/BWEngine) is too slow or indefinitely hangs.
 
If you take the thread dump using kill -3 option you will see the process is hanging on SecureRandom.

=========================================

daemon prio=10 tid=0x00007f6f68002800 nid=0x697b in Object.wait() [0x00007f6fa91ae000]
   java.lang.Thread.State: RUNNABLE
    at sun.security.provider.SecureRandom.engineNextBytes(Unknown Source)
    - locked <0x000000077a35f6b8> (a sun.security.provider.SecureRandom)
    at java.security.SecureRandom.nextBytes(Unknown Source)
    - locked <0x000000077a35f9d0> (a java.security.SecureRandom)
    at java.security.SecureRandom.next(Unknown Source)
    at java.util.Random.nextInt(Unknown Source)
    at org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom(SessionIdGeneratorBase.java:237)
    at org.apache.catalina.util.SessionIdGeneratorBase.getRandomBytes(SessionIdGeneratorBase.java:174)

=========================================

 

Cause:
This is environment specific and due to Java's Known issues on Linux, you might be running into known behavior . Where Java applications using SecureRandom on Linux for generating cryptographically strong random number in Java. Unfortunately, SecureRandom can be very slow. If it uses /dev/random on Linux, it can block for a long time.


One can compare the seed response between 2 environment .
      [a]. type cat /dev/random.

      [b]. type cat /dev/urandom
 
If you compare above response for  [a] will be slow compared [b].

For Java, this is known behavior (see NOTES 2 below). Suggested workaround in Resolution section below.

Issue/Introduction

Start of TIBCO executables (Administrator/AppManage/Obfuscate/BWEngine) takes longer time to startup or hangs on some Linux systems.

Resolution

Option 1:

In the $JAVA_HOME/jre/lib/security/java.security configuration file, you can add the line

=======================================

securerandom.source=file:/dev/./urandom

instead of existing default entry 

securerandom.source=file:/dev/random

=======================================


Option 2:

If you want to avoid doing the change globally in JRE  7 you can localized the change by simply adding the following property in the Administrator tra (tibcoadmin_<DomainName>.tra file .

=======================================.

java.property.java.security.egd=file:/dev/./urandom

=======================================.

NOTES :
1). The above slow start up behavior can affect other tra tools(  like obfuscate ,AppManage etc.) or BW application , but since you are not facing this issue with other tools, you can monitor and if needed add same properties to AppManage.tra ,obfuscate.tra or bwengine.tra.

2). Some Known Bugs in JRE : 
For your reference you can refer to a few defects on Oracle's website:

Latest bug for JRE 1.7,1.6.
JDK-6521844 : SecureRandom hangs on Linux Systems : http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6521844

The following is an old bug that gives a better explanation.
JDK-4705093 : Use /dev/urandom rather than /dev/random if it exists :  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4705093
 

Additional Information

 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4705093
 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6521844