Skip to content

Commit

Permalink
Fix possible thread leak in PN when recompiled
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
PseudoKnight committed Jan 3, 2025
1 parent 5f41400 commit 300752c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public ReadWriteFileConnection(URI uri, File workingDirectory, String blankDataM
reader.getTopLevelFile().createNewFile();
}
this.blankDataModel = blankDataModel;
this.service = new ThreadPoolExecutor(1, 1,
this.service = new ThreadPoolExecutor(0, 1,
60L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(),
new ThreadFactory() {
Expand Down

0 comments on commit 300752c

Please sign in to comment.