From be32ab22232f2aa8d2db13bdfa6387fc9caca19f Mon Sep 17 00:00:00 2001 From: wusheng Date: Thu, 6 Jul 2017 22:51:14 +0800 Subject: [PATCH] Finish codes about sync dictionary of Application and ServiceName. --- .../dictionary/ApplicationDictionary.java | 22 ++- .../dictionary/OperationNameDictionary.java | 41 +++++- .../remote/AppAndServiceRegisterClient.java | 136 ++++++++++++++++++ .../remote/ApplicationRegisterClient.java | 119 --------------- .../agent/core/remote/GRPCChannelManager.java | 76 +++------- ...skywalking.apm.agent.core.boot.BootService | 2 +- 6 files changed, 215 insertions(+), 181 deletions(-) create mode 100644 apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/remote/AppAndServiceRegisterClient.java delete mode 100644 apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/remote/ApplicationRegisterClient.java diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/dictionary/ApplicationDictionary.java b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/dictionary/ApplicationDictionary.java index 5859717063..295f4476df 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/dictionary/ApplicationDictionary.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/dictionary/ApplicationDictionary.java @@ -4,6 +4,10 @@ import io.netty.util.internal.ConcurrentSet; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; +import org.skywalking.apm.network.proto.Application; +import org.skywalking.apm.network.proto.ApplicationMapping; +import org.skywalking.apm.network.proto.ApplicationRegisterServiceGrpc; +import org.skywalking.apm.network.proto.KeyWithIntegerValue; /** * Map of application id to application code, which is from the collector side. @@ -13,15 +17,29 @@ import java.util.concurrent.ConcurrentHashMap; public enum ApplicationDictionary { INSTANCE; private Map applicationDictionary = new ConcurrentHashMap(); - private Set unRegisterApplication = new ConcurrentSet(); + private Set unRegisterApplications = new ConcurrentSet(); public PossibleFound find(String applicationCode) { Integer applicationId = applicationDictionary.get(applicationCode); if (applicationId != null) { return new Found(applicationId); } else { - unRegisterApplication.add(applicationCode); + unRegisterApplications.add(applicationCode); return new NotFound(); } } + + public void syncRemoteDictionary( + ApplicationRegisterServiceGrpc.ApplicationRegisterServiceBlockingStub applicationRegisterServiceBlockingStub) { + if (unRegisterApplications.size() > 0) { + ApplicationMapping applicationMapping = applicationRegisterServiceBlockingStub.register( + Application.newBuilder().addAllApplicationCode(unRegisterApplications).build()); + if (applicationMapping.getApplicationCount() > 0) { + for (KeyWithIntegerValue keyWithIntegerValue : applicationMapping.getApplicationList()) { + unRegisterApplications.remove(keyWithIntegerValue.getKey()); + applicationDictionary.put(keyWithIntegerValue.getKey(), keyWithIntegerValue.getValue()); + } + } + } + } } diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/dictionary/OperationNameDictionary.java b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/dictionary/OperationNameDictionary.java index 5ada580287..9f575b50a2 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/dictionary/OperationNameDictionary.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/dictionary/OperationNameDictionary.java @@ -4,6 +4,11 @@ import io.netty.util.internal.ConcurrentSet; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; +import org.skywalking.apm.network.proto.ServiceNameCollection; +import org.skywalking.apm.network.proto.ServiceNameDiscoveryServiceGrpc; +import org.skywalking.apm.network.proto.ServiceNameElement; +import org.skywalking.apm.network.proto.ServiceNameMappingCollection; +import org.skywalking.apm.network.proto.ServiceNameMappingElement; /** * @author wusheng @@ -11,7 +16,7 @@ import java.util.concurrent.ConcurrentHashMap; public enum OperationNameDictionary { INSTANCE; private Map operationNameDictionary = new ConcurrentHashMap(); - private Set unRegisterOperationName = new ConcurrentSet(); + private Set unRegisterOperationNames = new ConcurrentSet(); public PossibleFound find(int applicationId, String operationName) { OperationNameKey key = new OperationNameKey(applicationId, operationName); @@ -19,11 +24,35 @@ public enum OperationNameDictionary { if (operationId != null) { return new Found(applicationId); } else { - unRegisterOperationName.add(key); + unRegisterOperationNames.add(key); return new NotFound(); } } + public void syncRemoteDictionary( + ServiceNameDiscoveryServiceGrpc.ServiceNameDiscoveryServiceBlockingStub serviceNameDiscoveryServiceBlockingStub) { + if (unRegisterOperationNames.size() > 0) { + ServiceNameCollection.Builder builder = ServiceNameCollection.newBuilder(); + for (OperationNameKey operationNameKey : unRegisterOperationNames) { + ServiceNameElement serviceNameElement = ServiceNameElement.newBuilder() + .setApplicationId(operationNameKey.getApplicationId()) + .setServiceName(operationNameKey.getOperationName()) + .build(); + builder.addElements(serviceNameElement); + } + ServiceNameMappingCollection serviceNameMappingCollection = serviceNameDiscoveryServiceBlockingStub.discovery(builder.build()); + if (serviceNameMappingCollection.getElementsCount() > 0) { + for (ServiceNameMappingElement serviceNameMappingElement : serviceNameMappingCollection.getElementsList()) { + OperationNameKey key = new OperationNameKey( + serviceNameMappingElement.getElement().getApplicationId(), + serviceNameMappingElement.getElement().getServiceName()); + unRegisterOperationNames.remove(key); + operationNameDictionary.put(key, serviceNameMappingElement.getServiceId()); + } + } + } + } + private class OperationNameKey { private int applicationId; private String operationName; @@ -33,6 +62,14 @@ public enum OperationNameDictionary { this.operationName = operationName; } + public int getApplicationId() { + return applicationId; + } + + public String getOperationName() { + return operationName; + } + @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/remote/AppAndServiceRegisterClient.java b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/remote/AppAndServiceRegisterClient.java new file mode 100644 index 0000000000..1ce12cb503 --- /dev/null +++ b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/remote/AppAndServiceRegisterClient.java @@ -0,0 +1,136 @@ +package org.skywalking.apm.agent.core.remote; + +import io.grpc.ManagedChannel; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import org.skywalking.apm.agent.core.boot.BootService; +import org.skywalking.apm.agent.core.boot.ServiceManager; +import org.skywalking.apm.agent.core.conf.Config; +import org.skywalking.apm.agent.core.conf.RemoteDownstreamConfig; +import org.skywalking.apm.agent.core.context.TracingContext; +import org.skywalking.apm.agent.core.context.TracingContextListener; +import org.skywalking.apm.agent.core.context.trace.TraceSegment; +import org.skywalking.apm.agent.core.dictionary.ApplicationDictionary; +import org.skywalking.apm.agent.core.dictionary.DictionaryUtil; +import org.skywalking.apm.agent.core.dictionary.OperationNameDictionary; +import org.skywalking.apm.logging.ILog; +import org.skywalking.apm.logging.LogManager; +import org.skywalking.apm.network.proto.Application; +import org.skywalking.apm.network.proto.ApplicationInstance; +import org.skywalking.apm.network.proto.ApplicationInstanceHeartbeat; +import org.skywalking.apm.network.proto.ApplicationInstanceMapping; +import org.skywalking.apm.network.proto.ApplicationInstanceRecover; +import org.skywalking.apm.network.proto.ApplicationMapping; +import org.skywalking.apm.network.proto.ApplicationRegisterServiceGrpc; +import org.skywalking.apm.network.proto.InstanceDiscoveryServiceGrpc; +import org.skywalking.apm.network.proto.ServiceNameDiscoveryServiceGrpc; + +import static org.skywalking.apm.agent.core.remote.GRPCChannelStatus.CONNECTED; + +/** + * @author wusheng + */ +public class AppAndServiceRegisterClient implements BootService, GRPCChannelListener, Runnable, TracingContextListener { + private static final ILog logger = LogManager.getLogger(AppAndServiceRegisterClient.class); + + private volatile GRPCChannelStatus status = GRPCChannelStatus.DISCONNECT; + private volatile ApplicationRegisterServiceGrpc.ApplicationRegisterServiceBlockingStub applicationRegisterServiceBlockingStub; + private volatile InstanceDiscoveryServiceGrpc.InstanceDiscoveryServiceBlockingStub instanceDiscoveryServiceBlockingStub; + private volatile ServiceNameDiscoveryServiceGrpc.ServiceNameDiscoveryServiceBlockingStub serviceNameDiscoveryServiceBlockingStub; + private volatile ScheduledFuture applicationRegisterFuture; + private volatile boolean needRegisterRecover = false; + private volatile long lastSegmentTime = -1; + + @Override + public void statusChanged(GRPCChannelStatus status) { + if (CONNECTED.equals(status)) { + ManagedChannel channel = ServiceManager.INSTANCE.findService(GRPCChannelManager.class).getManagedChannel(); + applicationRegisterServiceBlockingStub = ApplicationRegisterServiceGrpc.newBlockingStub(channel); + instanceDiscoveryServiceBlockingStub = InstanceDiscoveryServiceGrpc.newBlockingStub(channel); + if (RemoteDownstreamConfig.Agent.APPLICATION_INSTANCE_ID != DictionaryUtil.nullValue()) { + needRegisterRecover = true; + } + serviceNameDiscoveryServiceBlockingStub = ServiceNameDiscoveryServiceGrpc.newBlockingStub(channel); + } else { + applicationRegisterServiceBlockingStub = null; + instanceDiscoveryServiceBlockingStub = null; + serviceNameDiscoveryServiceBlockingStub = null; + } + this.status = status; + } + + @Override + public void beforeBoot() throws Throwable { + ServiceManager.INSTANCE.findService(GRPCChannelManager.class).addChannelListener(this); + } + + @Override + public void boot() throws Throwable { + applicationRegisterFuture = Executors + .newSingleThreadScheduledExecutor() + .scheduleAtFixedRate(this, 0, 10, TimeUnit.SECONDS); + } + + @Override + public void afterBoot() throws Throwable { + TracingContext.ListenerManager.add(this); + } + + @Override + public void run() { + if (CONNECTED.equals(status)) { + try { + if (RemoteDownstreamConfig.Agent.APPLICATION_ID == DictionaryUtil.nullValue()) { + if (applicationRegisterServiceBlockingStub != null) { + ApplicationMapping applicationMapping = applicationRegisterServiceBlockingStub.register( + Application.newBuilder().addApplicationCode(Config.Agent.APPLICATION_CODE).build()); + if (applicationMapping.getApplicationCount() > 0) { + RemoteDownstreamConfig.Agent.APPLICATION_ID = applicationMapping.getApplication(0).getValue(); + } + } + } else { + if (instanceDiscoveryServiceBlockingStub != null) { + if (RemoteDownstreamConfig.Agent.APPLICATION_INSTANCE_ID == DictionaryUtil.nullValue()) { + + ApplicationInstanceMapping instanceMapping = instanceDiscoveryServiceBlockingStub.register(ApplicationInstance.newBuilder() + .setApplicationId(RemoteDownstreamConfig.Agent.APPLICATION_ID) + .setRegisterTime(System.currentTimeMillis()) + .build()); + if (instanceMapping.getApplicationInstanceId() != DictionaryUtil.nullValue()) { + RemoteDownstreamConfig.Agent.APPLICATION_INSTANCE_ID + = instanceMapping.getApplicationInstanceId(); + } + } else { + if (needRegisterRecover) { + instanceDiscoveryServiceBlockingStub.registerRecover(ApplicationInstanceRecover.newBuilder() + .setApplicationId(RemoteDownstreamConfig.Agent.APPLICATION_ID) + .setApplicationInstanceId(RemoteDownstreamConfig.Agent.APPLICATION_INSTANCE_ID) + .setRegisterTime(System.currentTimeMillis()) + .build()); + } else { + if (lastSegmentTime - System.currentTimeMillis() > 60 * 1000) { + instanceDiscoveryServiceBlockingStub.heartbeat(ApplicationInstanceHeartbeat.newBuilder() + .setApplicationInstanceId(RemoteDownstreamConfig.Agent.APPLICATION_INSTANCE_ID) + .setHeartbeatTime(System.currentTimeMillis()) + .build()); + } + } + + ApplicationDictionary.INSTANCE.syncRemoteDictionary(applicationRegisterServiceBlockingStub); + OperationNameDictionary.INSTANCE.syncRemoteDictionary(serviceNameDiscoveryServiceBlockingStub); + } + } + } + } catch (Throwable t) { + logger.error(t, "AppAndServiceRegisterClient execute fail."); + ServiceManager.INSTANCE.findService(GRPCChannelManager.class).reportError(t); + } + } + } + + @Override + public void afterFinished(TraceSegment traceSegment) { + lastSegmentTime = System.currentTimeMillis(); + } +} diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/remote/ApplicationRegisterClient.java b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/remote/ApplicationRegisterClient.java deleted file mode 100644 index fda09b5d5a..0000000000 --- a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/remote/ApplicationRegisterClient.java +++ /dev/null @@ -1,119 +0,0 @@ -package org.skywalking.apm.agent.core.remote; - -import io.grpc.ManagedChannel; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; -import org.skywalking.apm.agent.core.boot.BootService; -import org.skywalking.apm.agent.core.boot.ServiceManager; -import org.skywalking.apm.agent.core.conf.Config; -import org.skywalking.apm.agent.core.conf.RemoteDownstreamConfig; -import org.skywalking.apm.agent.core.context.TracingContext; -import org.skywalking.apm.agent.core.context.TracingContextListener; -import org.skywalking.apm.agent.core.context.trace.TraceSegment; -import org.skywalking.apm.agent.core.dictionary.DictionaryUtil; -import org.skywalking.apm.network.proto.Application; -import org.skywalking.apm.network.proto.ApplicationInstance; -import org.skywalking.apm.network.proto.ApplicationInstanceHeartbeat; -import org.skywalking.apm.network.proto.ApplicationInstanceMapping; -import org.skywalking.apm.network.proto.ApplicationInstanceRecover; -import org.skywalking.apm.network.proto.ApplicationMapping; -import org.skywalking.apm.network.proto.ApplicationRegisterServiceGrpc; -import org.skywalking.apm.network.proto.InstanceDiscoveryServiceGrpc; - -import static org.skywalking.apm.agent.core.remote.GRPCChannelStatus.CONNECTED; - -/** - * @author wusheng - */ -public class ApplicationRegisterClient implements BootService, GRPCChannelListener, Runnable, TracingContextListener { - private volatile GRPCChannelStatus status = GRPCChannelStatus.DISCONNECT; - private volatile ApplicationRegisterServiceGrpc.ApplicationRegisterServiceBlockingStub applicationRegisterServiceBlockingStub; - private volatile InstanceDiscoveryServiceGrpc.InstanceDiscoveryServiceBlockingStub instanceDiscoveryServiceBlockingStub; - private volatile ScheduledFuture applicationRegisterFuture; - private volatile boolean needRegisterRecover = false; - private volatile long lastSegmentTime = -1; - - @Override - public void statusChanged(GRPCChannelStatus status) { - if (CONNECTED.equals(status)) { - ManagedChannel channel = ServiceManager.INSTANCE.findService(GRPCChannelManager.class).getManagedChannel(); - if (RemoteDownstreamConfig.Agent.APPLICATION_ID == DictionaryUtil.nullValue()) { - applicationRegisterServiceBlockingStub = ApplicationRegisterServiceGrpc.newBlockingStub(channel); - } else { - instanceDiscoveryServiceBlockingStub = InstanceDiscoveryServiceGrpc.newBlockingStub(channel); - if (RemoteDownstreamConfig.Agent.APPLICATION_INSTANCE_ID != DictionaryUtil.nullValue()) { - needRegisterRecover = true; - } - } - } else { - applicationRegisterServiceBlockingStub = null; - } - this.status = status; - } - - @Override - public void beforeBoot() throws Throwable { - ServiceManager.INSTANCE.findService(GRPCChannelManager.class).addChannelListener(this); - } - - @Override - public void boot() throws Throwable { - applicationRegisterFuture = Executors - .newSingleThreadScheduledExecutor() - .scheduleAtFixedRate(this, 0, 10, TimeUnit.SECONDS); - } - - @Override - public void afterBoot() throws Throwable { - TracingContext.ListenerManager.add(this); - } - - @Override - public void run() { - if (CONNECTED.equals(status)) { - if (RemoteDownstreamConfig.Agent.APPLICATION_ID == DictionaryUtil.nullValue()) { - if (applicationRegisterServiceBlockingStub != null) { - ApplicationMapping applicationMapping = applicationRegisterServiceBlockingStub.register( - Application.newBuilder().addApplicationCode(Config.Agent.APPLICATION_CODE).build()); - if (applicationMapping.getApplicationCount() > 0) { - RemoteDownstreamConfig.Agent.APPLICATION_ID = applicationMapping.getApplication(0).getValue(); - } - } - } else { - if (RemoteDownstreamConfig.Agent.APPLICATION_INSTANCE_ID == DictionaryUtil.nullValue()) { - if (instanceDiscoveryServiceBlockingStub != null) { - ApplicationInstanceMapping instanceMapping = instanceDiscoveryServiceBlockingStub.register(ApplicationInstance.newBuilder() - .setApplicationId(RemoteDownstreamConfig.Agent.APPLICATION_ID) - .setRegisterTime(System.currentTimeMillis()) - .build()); - if (instanceMapping.getApplicationInstanceId() != DictionaryUtil.nullValue()) { - RemoteDownstreamConfig.Agent.APPLICATION_INSTANCE_ID - = instanceMapping.getApplicationInstanceId(); - } - } - } else { - if (needRegisterRecover) { - instanceDiscoveryServiceBlockingStub.registerRecover(ApplicationInstanceRecover.newBuilder() - .setApplicationId(RemoteDownstreamConfig.Agent.APPLICATION_ID) - .setApplicationInstanceId(RemoteDownstreamConfig.Agent.APPLICATION_INSTANCE_ID) - .setRegisterTime(System.currentTimeMillis()) - .build()); - } else { - if (lastSegmentTime - System.currentTimeMillis() > 60 * 1000) { - instanceDiscoveryServiceBlockingStub.heartbeat(ApplicationInstanceHeartbeat.newBuilder() - .setApplicationInstanceId(RemoteDownstreamConfig.Agent.APPLICATION_INSTANCE_ID) - .setHeartbeatTime(System.currentTimeMillis()) - .build()); - } - } - } - } - } - } - - @Override - public void afterFinished(TraceSegment traceSegment) { - lastSegmentTime = System.currentTimeMillis(); - } -} diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/remote/GRPCChannelManager.java b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/remote/GRPCChannelManager.java index 818c2c6bc3..068809d425 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/remote/GRPCChannelManager.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/remote/GRPCChannelManager.java @@ -10,6 +10,9 @@ import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Random; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; import org.skywalking.apm.agent.core.boot.BootService; import org.skywalking.apm.agent.core.conf.RemoteDownstreamConfig; import org.skywalking.apm.logging.ILog; @@ -21,11 +24,12 @@ import org.skywalking.apm.logging.LogManager; public class GRPCChannelManager implements BootService, Runnable { private static final ILog logger = LogManager.getLogger(DiscoveryRestServiceClient.class); - private volatile Thread channelManagerThread = null; private volatile ManagedChannel managedChannel = null; - private volatile long nextStartTime = 0; + private volatile ScheduledFuture connectCheckFuture; + private volatile boolean reconnect = true; private Random random = new Random(); private List listeners = Collections.synchronizedList(new LinkedList()); + private final int retryCycle = 30; @Override public void beforeBoot() throws Throwable { @@ -34,7 +38,9 @@ public class GRPCChannelManager implements BootService, Runnable { @Override public void boot() throws Throwable { - this.connectInBackground(false); + connectCheckFuture = Executors + .newSingleThreadScheduledExecutor() + .scheduleAtFixedRate(this, 0, retryCycle, TimeUnit.SECONDS); } @Override @@ -42,38 +48,9 @@ public class GRPCChannelManager implements BootService, Runnable { } - private void connectInBackground(boolean forceStart) { - if (channelManagerThread == null || !channelManagerThread.isAlive()) { - synchronized (this) { - if (forceStart) { - /** - * The startup has invoked in 30 seconds before, don't invoke again. - */ - if (System.currentTimeMillis() < nextStartTime) { - return; - } - } - resetNextStartTime(); - if (channelManagerThread == null || !channelManagerThread.isAlive()) { - if (forceStart || managedChannel == null || managedChannel.isTerminated() || managedChannel.isShutdown()) { - if (managedChannel != null) { - managedChannel.shutdownNow(); - notify(GRPCChannelStatus.DISCONNECT); - } - Thread channelManagerThread = new Thread(this, "ChannelManagerThread"); - channelManagerThread.setDaemon(true); - channelManagerThread.start(); - } - } - } - } - } - @Override public void run() { - while (true) { - resetNextStartTime(); - + if (reconnect) { if (RemoteDownstreamConfig.Collector.GRPC_SERVERS.size() > 0) { int index = random.nextInt() % RemoteDownstreamConfig.Collector.GRPC_SERVERS.size(); String server = RemoteDownstreamConfig.Collector.GRPC_SERVERS.get(index); @@ -85,17 +62,15 @@ public class GRPCChannelManager implements BootService, Runnable { .maxInboundMessageSize(1024 * 1024 * 50) .usePlaintext(true); managedChannel = channelBuilder.build(); + reconnect = false; notify(GRPCChannelStatus.CONNECTED); - break; + return; } catch (Throwable t) { logger.error(t, "Create channel to {} fail.", server); } } - resetNextStartTime(); - int waitTime = 5 * 1000; - logger.debug("Selected collector grpc service is not available. Wait {} millis to try", waitTime); - try2Sleep(waitTime); + logger.debug("Selected collector grpc service is not available. Wait {} seconds to retry", retryCycle); } } @@ -114,13 +89,17 @@ public class GRPCChannelManager implements BootService, Runnable { */ public void reportError(Throwable throwable) { if (isNetworkError(throwable)) { - this.connectInBackground(true); + reconnect = true; } } private void notify(GRPCChannelStatus status) { for (GRPCChannelListener listener : listeners) { - listener.statusChanged(status); + try { + listener.statusChanged(status); + } catch (Throwable t) { + logger.error(t, "Fail to notify {} about channel connected.", listener.getClass().getName()); + } } } @@ -146,21 +125,4 @@ public class GRPCChannelManager implements BootService, Runnable { } return false; } - - private void resetNextStartTime() { - nextStartTime = System.currentTimeMillis() + 20 * 1000; - } - - /** - * Try to sleep, and ignore the {@link InterruptedException} - * - * @param millis the length of time to sleep in milliseconds - */ - private void try2Sleep(long millis) { - try { - Thread.sleep(millis); - } catch (InterruptedException e) { - - } - } } diff --git a/apm-sniffer/apm-agent-core/src/main/resources/META-INF/services/org.skywalking.apm.agent.core.boot.BootService b/apm-sniffer/apm-agent-core/src/main/resources/META-INF/services/org.skywalking.apm.agent.core.boot.BootService index 1b2c7af435..9d1e1a4b90 100644 --- a/apm-sniffer/apm-agent-core/src/main/resources/META-INF/services/org.skywalking.apm.agent.core.boot.BootService +++ b/apm-sniffer/apm-agent-core/src/main/resources/META-INF/services/org.skywalking.apm.agent.core.boot.BootService @@ -4,4 +4,4 @@ org.skywalking.apm.agent.core.remote.CollectorDiscoveryService org.skywalking.apm.agent.core.sampling.SamplingService org.skywalking.apm.agent.core.remote.GRPCChannelManager org.skywalking.apm.agent.core.jvm.JVMService -org.skywalking.apm.agent.core.remote.ApplicationRegisterClient +org.skywalking.apm.agent.core.remote.AppAndServiceRegisterClient -- GitLab