Fix exception when threads write files to same dir
When Multiple FileAppenders attempt to write files to the same nonexistent directory, concurrent threads could attempt to create the directory at the same time, where only one succeeds, while the others hit an IllegalStateException. This patch modifies FileUtil.createMissingParentDirectories() to gracefully handle existing directories (no exceptions thrown). This patch also removes FileUtil.isParentDirectoryCreationRequired() as this allows for race conditions between the existence-check and the directory creation. Note that File.mkdirs() already performs an existence-check. Fixes LOGBACK-128
parent
0c26c814
Please register or sign in to comment