Bug 47276

Summary: Repeated log warnings when /dev/urandom is not readable
Product: Tomcat 5 Reporter: Tim Whittington <Tim.Whittington>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P2    
Version: 5.5.27   
Target Milestone: ---   
Hardware: Other   
OS: AIX   

Description Tim Whittington 2009-05-27 23:33:42 UTC
When the /dev/urandom device is not readable by the Tomcat process, we see repeated "Failed to close randomIS" messages logged at the WARN level.

The issue appears to be in ManagerBase.setRandomFile - if the random device is not readable it fails to open the file (i.e. construct the FileInputStream - at least on AIX this fails immediately), and then blindly tries to close the inputstream resulting in an NPE and the "Failed to close randomIS" message.

A quick null check before closing would probably fix this.
A solution that warned once on an inaccessible random device and didn't try to reopen it thereafter might be better.
Comment 1 Konstantin Kolinko 2009-07-17 10:41:58 UTC
It is duplicate of bug 46967, that is already fixed in the 6.0.x branch.

*** This bug has been marked as a duplicate of bug 46967 ***