Skip to content

Commit 300752c

Browse files
committed
Fix possible thread leak in PN when recompiled
Bug affected the Persistence Network when it was configured to use a file data source (yml, json, ini, csv, xml). If a recompile is followed by garbage collection, a thread leak may occur. Setting corePoolSize to zero allows the thread to timeout, and ultimately the whole pool to be garbage collected.
1 parent 5f41400 commit 300752c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/laytonsmith/persistence/io/ReadWriteFileConnection.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public ReadWriteFileConnection(URI uri, File workingDirectory, String blankDataM
7676
reader.getTopLevelFile().createNewFile();
7777
}
7878
this.blankDataModel = blankDataModel;
79-
this.service = new ThreadPoolExecutor(1, 1,
79+
this.service = new ThreadPoolExecutor(0, 1,
8080
60L, TimeUnit.MILLISECONDS,
8181
new LinkedBlockingQueue<Runnable>(),
8282
new ThreadFactory() {

0 commit comments

Comments
 (0)