Logs Cannot Be Written After VM File Handles Are Used Up
Description
Fault injection: VM file handles are used up, and logs cannot be printed after the fault is rectified. IOException: Stream Closed. [A clear and concise description of what the bug is.]
Configuration
Version: [Log4j version] 2.71.1 Operating system: [OS and version] linux JDK: [JDK distribution and version] openjdk 1.8
Logs
Logs during fault injection:
Logs After Fault Recovery:

[Stacktraces, errors, etc. relevant applications logs.]
Reproduction
[An isolated test reproducing the test. JUnit tests similar to the ones in the code base are extremely appreciated.]
org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFileManager#writeToDestination
randomAccessFile should check whether The Stream is closed。

Once the file rollover fails the Appender is essentially dead as it no longer has an open stream. This is not unique to RandomAccessFile as all file appenders will face this. I really don't see a good way to fix this.
Once the file rollover fails the Appender is essentially dead as it no longer has an open stream. This is not unique to RandomAccessFile as all file appenders will face this. I really don't see a good way to fix this.
IOException handling,when Stream Closed, randomAccessFile is set to null. A new access file will be created next time. Is this OK?