summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-08-22 23:39:47 +0200
committerGitHub <noreply@github.com>2019-08-22 23:39:47 +0200
commit2ba8bc0cd4aabbe12f98323cb34571a69928c07a (patch)
treee0a17b4f918aa740041856c4664ce3ef6e2ca2db /config
parent512d0a8547aea8586d0c1e757707a9c596789452 (diff)
parent96e15a5b2f3d8211aa6bc06a22bc8adb513af73b (diff)
Merge pull request #10383 from vespa-engine/bjorncs/config-thread-name
Assign name to config thread
Diffstat (limited to 'config')
-rw-r--r--config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigRequester.java34
1 files changed, 11 insertions, 23 deletions
diff --git a/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigRequester.java b/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigRequester.java
index 734935e0658..0eaabf699b5 100644
--- a/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigRequester.java
+++ b/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigRequester.java
@@ -1,17 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.subscription.impl;
-import java.text.SimpleDateFormat;
-import java.time.Duration;
-import java.time.Instant;
-import java.util.TimeZone;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.TimeUnit;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
import com.yahoo.config.ConfigInstance;
import com.yahoo.config.ConfigurationRuntimeException;
import com.yahoo.config.subscription.ConfigSourceSet;
@@ -24,9 +13,17 @@ import com.yahoo.vespa.config.ErrorCode;
import com.yahoo.vespa.config.ErrorType;
import com.yahoo.vespa.config.TimingValues;
import com.yahoo.vespa.config.protocol.JRTClientConfigRequest;
-import com.yahoo.yolean.Exceptions;
import com.yahoo.vespa.config.protocol.JRTConfigRequestFactory;
import com.yahoo.vespa.config.protocol.Trace;
+import com.yahoo.yolean.Exceptions;
+
+import java.time.Duration;
+import java.time.Instant;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+import java.util.logging.Level;
+import java.util.logging.Logger;
/**
* This class fetches config payload using JRT, and acts as the callback target.
@@ -53,13 +50,6 @@ public class JRTConfigRequester implements RequestWaiter {
/* Time to be added to server timeout to create client timeout. This is the time allowed for the server to respond after serverTimeout has elapsed. */
private static final Double additionalTimeForClientTimeout = 5.0;
- private static final SimpleDateFormat yyyyMMddz;
-
- static {
- yyyyMMddz = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
- yyyyMMddz.setTimeZone(TimeZone.getTimeZone("GMT"));
- }
-
/**
* Returns a new requester
* @param connectionPool The connectionPool to use
@@ -305,12 +295,10 @@ public class JRTConfigRequester implements RequestWaiter {
scheduler.shutdown();
}
- private class JRTSourceThreadFactory implements ThreadFactory {
- @SuppressWarnings("NullableProblems")
+ private static class JRTSourceThreadFactory implements ThreadFactory {
@Override
public Thread newThread(Runnable runnable) {
- ThreadFactory tf = Executors.defaultThreadFactory();
- Thread t = tf.newThread(runnable);
+ Thread t = new Thread(runnable, String.format("jrt-config-requester-%d", System.currentTimeMillis()));
// We want a daemon thread to avoid hanging threads in case something goes wrong in the config system
t.setDaemon(true);
return t;