summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2023-05-26 14:09:50 +0200
committerSimon Rettberg2023-05-26 14:09:50 +0200
commit9889f64daa9449ae29fe1d7e371affeb730dc8de (patch)
tree0a5cd1da84e6ec2ea20d5a2a3f41b0800c1e678c
parent[server] log4j: Try to silence warnings from thrift lib (diff)
downloadtutor-module-9889f64daa9449ae29fe1d7e371affeb730dc8de.tar.gz
tutor-module-9889f64daa9449ae29fe1d7e371affeb730dc8de.tar.xz
tutor-module-9889f64daa9449ae29fe1d7e371affeb730dc8de.zip
[server] Assign proper names to threads and thread pools
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java16
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java2
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/SyncTransferHandler.java2
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/WebServer.java3
4 files changed, 12 insertions, 11 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java
index 3b1a8de6..717ef221 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java
@@ -164,29 +164,29 @@ public class App {
DeleteOldUsers.init();
// Shared executor for SSL thrift and HTTP thrift
- ExecutorService es = new GrowingThreadPoolExecutor(3, 128, 1, TimeUnit.MINUTES,
- new ArrayBlockingQueue<Runnable>(4), new PrioThreadFactory("SSL"));
+ ExecutorService es = new GrowingThreadPoolExecutor(3, 128, 2, TimeUnit.MINUTES,
+ new ArrayBlockingQueue<Runnable>(4), new PrioThreadFactory("Web/SSL"));
// Start Thrift Server
Thread t;
// Plain
- t = new Thread(new BinaryListener(9090, false, null));
+ t = new Thread(new BinaryListener(9090, false, null), "T-Pln:9090");
t.setDaemon(true);
t.start();
// SSL
- t = new Thread(new BinaryListener(9091, true, es));
+ t = new Thread(new BinaryListener(9091, true, es), "T-SSL:9091");
t.start();
// Start RPC httpd
- t = new Thread(new WebServer(9080));
+ t = new Thread(new WebServer(9080), "Rhttpd:9080");
t.setDaemon(true);
t.start();
- // Start RPC httpd
- t = new Thread(new JsonHttpListener(9081, es));
+ // Start JSON-Thrift httpd
+ t = new Thread(new JsonHttpListener(9081, es), "Thttpd:9081");
t.setDaemon(true);
t.start();
- Runtime.getRuntime().addShutdownHook(new Thread() {
+ Runtime.getRuntime().addShutdownHook(new Thread("Shutdown") {
@Override
public void run() {
QuickTimer.cancel();
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java
index 85f459c9..0d283848 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java
@@ -47,7 +47,7 @@ public class FileServer implements IncomingEvent {
private final ExecutorService transferPool = new GrowingThreadPoolExecutor(1, Constants.MAX_UPLOADS
+ Constants.MAX_DOWNLOADS, 1, TimeUnit.MINUTES, new SynchronousQueue<Runnable>(),
- new PrioThreadFactory("ClientTransferPool", Thread.NORM_PRIORITY - 2));
+ new PrioThreadFactory("CTransf", Thread.NORM_PRIORITY - 2));
/**
* All currently running uploads, indexed by token
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/SyncTransferHandler.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/SyncTransferHandler.java
index e8bdc83a..448bcb68 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/SyncTransferHandler.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/SyncTransferHandler.java
@@ -46,7 +46,7 @@ public class SyncTransferHandler {
private static final GrowingThreadPoolExecutor transferPool = new GrowingThreadPoolExecutor(1,
Constants.MAX_MASTER_UPLOADS + Constants.MAX_MASTER_DOWNLOADS, 1, TimeUnit.MINUTES,
- new ArrayBlockingQueue<Runnable>(1), new PrioThreadFactory("MasterTransferPool",
+ new ArrayBlockingQueue<Runnable>(1), new PrioThreadFactory("MTransf",
Thread.NORM_PRIORITY - 3));
/**
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/WebServer.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/WebServer.java
index 3f32ae16..c3655572 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/WebServer.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/WebServer.java
@@ -28,6 +28,7 @@ import org.openslx.bwlp.thrift.iface.NetShareAuth;
import org.openslx.bwlp.thrift.iface.TNotFoundException;
import org.openslx.util.GrowingThreadPoolExecutor;
import org.openslx.util.Json;
+import org.openslx.util.PrioThreadFactory;
import org.openslx.util.TarArchiveUtil.TarArchiveWriter;
import org.openslx.util.Util;
import org.simpleframework.xml.Serializer;
@@ -40,7 +41,7 @@ public class WebServer extends NanoHTTPD {
private static final Logger LOGGER = LogManager.getLogger(WebServer.class);
private static final ThreadPoolExecutor tpe = new GrowingThreadPoolExecutor(1, 8, 1, TimeUnit.MINUTES,
- new ArrayBlockingQueue<Runnable>(16));
+ new ArrayBlockingQueue<Runnable>(16), new PrioThreadFactory("Web"));
private static final Serializer serializer = new Persister();