mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-10 02:26:18 +00:00
Added NamingThreadFactory to ensure that all code creating thread pool executors was marking the threads.
Otherwise we get a bunch of pool-17-thread-5 with no clue who created so many threads or why. Also simplifies existing code which previously had to write one-off ThreadFactory implementations just to set a name.
This commit is contained in:
1 parent
7a6c8654d9
commit
b305fe082c
9 files changed
+82
-56
No files matched your search
@@ -28,6 +28,7 @@ import hudson.model.TaskListener;
|
||||
import hudson.remoting.Channel;
|
||||
import hudson.util.DaemonThreadFactory;
|
||||
import hudson.util.ExceptionCatchingThreadFactory;
|
||||
import hudson.util.NamingThreadFactory;
|
||||
import hudson.util.NullStream;
|
||||
import hudson.util.StreamCopyThread;
|
||||
import hudson.util.ProcessTree;
|
||||
@@ -131,7 +132,7 @@ public abstract class Proc {
|
||||
*/
|
||||
public abstract OutputStream getStdin();
|
||||
|
||||
private static final ExecutorService executor = Executors.newCachedThreadPool(new ExceptionCatchingThreadFactory(new DaemonThreadFactory()));
|
||||
private static final ExecutorService executor = Executors.newCachedThreadPool(new ExceptionCatchingThreadFactory(new NamingThreadFactory(new DaemonThreadFactory(), "Proc.executor")));
|
||||
|
||||
/**
|
||||
* Like {@link #join} but can be given a maximum time to wait.
|
||||
|
||||
Reference in new issue
Block a user