Skip to content

Commit 3ff8c23

Browse files
authored
[Deadlock] Move Agent-Version property reading away from the class loading stage (#436)
1 parent dd6c91c commit 3ff8c23

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Release Notes.
2323
* Add support for KafkaClients 3.x.
2424
* Support to customize the collect period of JVM relative metrics.
2525
* Upgrade netty-codec-http2 to 4.1.86.Final.
26+
* Move `Agent-Version` property reading away from the class loading stage to avoid deadlock when use `jarsigner`.
2627

2728
#### Documentation
2829

apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/AgentIDDecorator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
*/
4141
public class AgentIDDecorator implements ChannelDecorator {
4242
private static final ILog LOGGER = LogManager.getLogger(AgentIDDecorator.class);
43-
private static final Metadata.Key<String> AGENT_VERSION_HEAD_HEADER_NAME = Metadata.Key.of("Agent-Version", Metadata.ASCII_STRING_MARSHALLER);
43+
private static Metadata.Key<String> AGENT_VERSION_HEAD_HEADER_NAME;
4444
private String version = "UNKNOWN";
4545

4646
public AgentIDDecorator() {
@@ -61,6 +61,7 @@ public AgentIDDecorator() {
6161
}
6262
}
6363
}
64+
AGENT_VERSION_HEAD_HEADER_NAME = Metadata.Key.of("Agent-Version", Metadata.ASCII_STRING_MARSHALLER);
6465
} catch (Exception e) {
6566
LOGGER.warn("Can't read version from MANIFEST.MF in the agent jar");
6667
}

0 commit comments

Comments
 (0)