diff --git a/CHANGES.md b/CHANGES.md index f67237ae9..e8e029ff0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -23,6 +23,7 @@ Release Notes. * Add support for KafkaClients 3.x. * Support to customize the collect period of JVM relative metrics. * Upgrade netty-codec-http2 to 4.1.86.Final. +* Move `Agent-Version` property reading away from the class loading stage to avoid deadlock when use `jarsigner`. #### Documentation diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/AgentIDDecorator.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/AgentIDDecorator.java index 46ad74de1..414959751 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/AgentIDDecorator.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/AgentIDDecorator.java @@ -40,7 +40,7 @@ import org.apache.skywalking.apm.agent.core.logging.api.LogManager; */ public class AgentIDDecorator implements ChannelDecorator { private static final ILog LOGGER = LogManager.getLogger(AgentIDDecorator.class); - private static final Metadata.Key AGENT_VERSION_HEAD_HEADER_NAME = Metadata.Key.of("Agent-Version", Metadata.ASCII_STRING_MARSHALLER); + private static Metadata.Key AGENT_VERSION_HEAD_HEADER_NAME; private String version = "UNKNOWN"; public AgentIDDecorator() { @@ -61,6 +61,7 @@ public class AgentIDDecorator implements ChannelDecorator { } } } + AGENT_VERSION_HEAD_HEADER_NAME = Metadata.Key.of("Agent-Version", Metadata.ASCII_STRING_MARSHALLER); } catch (Exception e) { LOGGER.warn("Can't read version from MANIFEST.MF in the agent jar"); }