You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2023/01/06 06:24:43 UTC

[GitHub] [skywalking-java] jinrongzhang opened a new pull request, #437: Put `Agent-Version` property reading in premain stage to avoid deadlock when use `jarsigner`.

jinrongzhang opened a new pull request, #437:
URL: https://github.com/apache/skywalking-java/pull/437

   <!--
       ⚠️ Please make sure to read this template first, pull requests that don't accord with this template
       maybe closed without notice.
       Texts surrounded by `<` and `>` are meant to be replaced by you, e.g. <framework name>, <issue number>.
       Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]`
   -->
   
   <!-- ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👇 ====
   ### Fix <bug description or the bug issue number or bug issue link>
   - [ ] Add a unit test to verify that the fix works.
   - [ ] Explain briefly why the bug exists and how to fix it.
        ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👆 ==== -->
   
   <!-- ==== 🔌 Remove this line WHEN AND ONLY WHEN you're adding a new plugin, follow the checklist 👇 ====
   ### Add an agent plugin to support <framework name>
   - [ ] Add a test case for the new plugin, refer to [the doc](https://github.com/apache/skywalking-java/blob/main/docs/en/setup/service-agent/java-agent/Plugin-test.md)
   - [ ] Add a component id in [the component-libraries.yml](https://github.com/apache/skywalking/blob/master/oap-server/server-starter/src/main/resources/component-libraries.yml)
   - [ ] Add a logo in [the UI repo](https://github.com/apache/skywalking-rocketbot-ui/tree/master/src/views/components/topology/assets)
        ==== 🔌 Remove this line WHEN AND ONLY WHEN you're adding a new plugin, follow the checklist 👆 ==== -->
   
   <!-- ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👇 ====
   ### Improve the performance of <class or module or ...>
   - [ ] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking-java/blob/main/apm-commons/apm-datacarrier/src/test/java/org/apache/skywalking/apm/commons/datacarrier/LinkedArrayBenchmark.java)
   - [ ] The benchmark result.
   ```text
   <Paste the benchmark results here>
   ```
   - [ ] Links/URLs to the theory proof or discussion articles/blogs. <links/URLs here>
        ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👆 ==== -->
   
   <!-- ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👇 ====
   ### <Feature description>
   - [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
   - [ ] Update the documentation to include this new feature.
   - [ ] Tests(including UT, IT, E2E) are added to verify the new feature.
   - [ ] If it's UI related, attach the screenshots below.
        ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👆 ==== -->
   
   - [x] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes https://github.com/apache/skywalking/discussions/10221 .
   - [x] Update the [`CHANGES` log](https://github.com/apache/skywalking-java/blob/main/CHANGES.md).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #437: Put `Agent-Version` property reading in premain stage to avoid deadlock when use `jarsigner`.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #437:
URL: https://github.com/apache/skywalking-java/pull/437#discussion_r1063245067


##########
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/SnifferConfigInitializer.java:
##########
@@ -202,6 +210,36 @@ private static void overrideConfigBySystemProp() {
         }
     }
 
+    /**
+     * Set agent version(Described in MANIFEST.MF)
+     */
+    private static void setAgentVersion() {
+        //set default value
+        AGENT_SETTINGS.put("agent.version", "UNKNOWN");
+        try {
+            Enumeration<URL> resources = SnifferConfigInitializer.class.getClassLoader().getResources(JarFile.MANIFEST_NAME);
+            while (resources.hasMoreElements()) {
+                URL url = resources.nextElement();
+                LOGGER.info("SnifferConfigInitializer url:{}", url.toString());
+                try (InputStream is = url.openStream()) {
+                    if (is != null) {
+                        Manifest manifest = new Manifest(is);
+                        Attributes mainAttribs = manifest.getMainAttributes();
+                        String projectName = mainAttribs.getValue("Implementation-Vendor-Id");
+                        if (projectName != null) {
+                            if ("org.apache.skywalking".equals(projectName)) {
+                                String version = mainAttribs.getValue("Implementation-Version");
+                                AGENT_SETTINGS.put("agent.version", version);

Review Comment:
   A question, why do you use this kind rather than directly assign the version to `Config.Agent.VERSION`?
   AGENT_SETTINGS is used to override default settings. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #437: Put `Agent-Version` property reading in premain stage to avoid deadlock when use `jarsigner`.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #437:
URL: https://github.com/apache/skywalking-java/pull/437#discussion_r1063173687


##########
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java:
##########
@@ -178,6 +178,11 @@ public static class Agent {
          * Private key file. If ssl_cert_chain and ssl_key exist, will enable mTLS for gRPC channel.
          */
         public static String SSL_KEY_PATH;
+
+        /**
+         * Agent version, auto set value in agent start by read skywalking-agent.jar MANIFEST.MF file

Review Comment:
   ```suggestion
            * Agent version. This is set by the agent kernel through reading MANIFEST.MF file in the skywalking-agent.jar.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #437: Put `Agent-Version` property reading in premain stage to avoid deadlock when use `jarsigner`.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #437:
URL: https://github.com/apache/skywalking-java/pull/437#discussion_r1063175031


##########
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/SnifferConfigInitializer.java:
##########
@@ -202,6 +206,37 @@ private static void overrideConfigBySystemProp() {
         }
     }
 
+    /**
+     * set agent version(Described in MANIFEST.MF)
+     *
+     * */
+    private static void setAgentVersion() {
+        try {
+            ClassLoader classLoader = SnifferConfigInitializer.class.getClassLoader();
+            Enumeration<URL> resources = SnifferConfigInitializer.class.getClassLoader().getResources(JarFile.MANIFEST_NAME);
+            while (resources.hasMoreElements()) {
+                URL url = resources.nextElement();
+                LOGGER.info("SnifferConfigInitializer url:{}", url.toString());
+                try (InputStream is = url.openStream()) {
+                    if (is != null) {
+                        Manifest manifest = new Manifest(is);
+                        Attributes mainAttribs = manifest.getMainAttributes();
+                        String projectName = mainAttribs.getValue("Implementation-Vendor-Id");
+                        if (projectName != null) {
+                            if ("org.apache.skywalking".equals(projectName)) {
+                                String version = mainAttribs.getValue("Implementation-Version");
+                                AGENT_SETTINGS.put("agent.version", version);
+                            }
+                        }
+                    }
+                }
+            }

Review Comment:
   I think you missed to set `Config.Agent.VERSION` here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] jinrongzhang commented on a diff in pull request #437: Put `Agent-Version` property reading in premain stage to avoid deadlock when use `jarsigner`.

Posted by GitBox <gi...@apache.org>.
jinrongzhang commented on code in PR #437:
URL: https://github.com/apache/skywalking-java/pull/437#discussion_r1063232810


##########
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/SnifferConfigInitializer.java:
##########
@@ -202,6 +206,37 @@ private static void overrideConfigBySystemProp() {
         }
     }
 
+    /**
+     * set agent version(Described in MANIFEST.MF)
+     *
+     * */
+    private static void setAgentVersion() {
+        try {
+            ClassLoader classLoader = SnifferConfigInitializer.class.getClassLoader();
+            Enumeration<URL> resources = SnifferConfigInitializer.class.getClassLoader().getResources(JarFile.MANIFEST_NAME);
+            while (resources.hasMoreElements()) {
+                URL url = resources.nextElement();
+                LOGGER.info("SnifferConfigInitializer url:{}", url.toString());
+                try (InputStream is = url.openStream()) {
+                    if (is != null) {
+                        Manifest manifest = new Manifest(is);
+                        Attributes mainAttribs = manifest.getMainAttributes();
+                        String projectName = mainAttribs.getValue("Implementation-Vendor-Id");
+                        if (projectName != null) {
+                            if ("org.apache.skywalking".equals(projectName)) {
+                                String version = mainAttribs.getValue("Implementation-Version");
+                                AGENT_SETTINGS.put("agent.version", version);
+                            }
+                        }
+                    }
+                }
+            }

Review Comment:
   yes, i will fix it!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] jinrongzhang commented on a diff in pull request #437: Put `Agent-Version` property reading in premain stage to avoid deadlock when use `jarsigner`.

Posted by GitBox <gi...@apache.org>.
jinrongzhang commented on code in PR #437:
URL: https://github.com/apache/skywalking-java/pull/437#discussion_r1063318713


##########
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/SnifferConfigInitializer.java:
##########
@@ -202,6 +210,35 @@ private static void overrideConfigBySystemProp() {
         }
     }
 
+    /**
+     * Set agent version(Described in MANIFEST.MF)
+     */
+    private static void setAgentVersion() {
+        //set default value
+        Config.Agent.VERSION = "UNKNOWN";
+        try {
+            Enumeration<URL> resources = SnifferConfigInitializer.class.getClassLoader().getResources(JarFile.MANIFEST_NAME);
+            while (resources.hasMoreElements()) {
+                URL url = resources.nextElement();
+                LOGGER.info("SnifferConfigInitializer url:{}", url.toString());
+                try (InputStream is = url.openStream()) {
+                    if (is != null) {
+                        Manifest manifest = new Manifest(is);
+                        Attributes mainAttribs = manifest.getMainAttributes();
+                        String projectName = mainAttribs.getValue("Implementation-Vendor-Id");
+                        if (projectName != null) {
+                            if ("org.apache.skywalking".equals(projectName)) {
+                                Config.Agent.VERSION = mainAttribs.getValue("Implementation-Version");

Review Comment:
   fixed it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] kezhenxu94 commented on a diff in pull request #437: Put `Agent-Version` property reading in premain stage to avoid deadlock when use `jarsigner`.

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on code in PR #437:
URL: https://github.com/apache/skywalking-java/pull/437#discussion_r1063304964


##########
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/SnifferConfigInitializer.java:
##########
@@ -202,6 +210,35 @@ private static void overrideConfigBySystemProp() {
         }
     }
 
+    /**
+     * Set agent version(Described in MANIFEST.MF)
+     */
+    private static void setAgentVersion() {
+        //set default value
+        Config.Agent.VERSION = "UNKNOWN";
+        try {
+            Enumeration<URL> resources = SnifferConfigInitializer.class.getClassLoader().getResources(JarFile.MANIFEST_NAME);
+            while (resources.hasMoreElements()) {
+                URL url = resources.nextElement();
+                LOGGER.info("SnifferConfigInitializer url:{}", url.toString());
+                try (InputStream is = url.openStream()) {
+                    if (is != null) {
+                        Manifest manifest = new Manifest(is);
+                        Attributes mainAttribs = manifest.getMainAttributes();
+                        String projectName = mainAttribs.getValue("Implementation-Vendor-Id");
+                        if (projectName != null) {
+                            if ("org.apache.skywalking".equals(projectName)) {
+                                Config.Agent.VERSION = mainAttribs.getValue("Implementation-Version");

Review Comment:
   Consider adding a `break` here as soon as you find the version needed. 



##########
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java:
##########
@@ -178,6 +178,11 @@ public static class Agent {
          * Private key file. If ssl_cert_chain and ssl_key exist, will enable mTLS for gRPC channel.
          */
         public static String SSL_KEY_PATH;
+
+        /**
+         * Agent version. This is set by the agent kernel through reading MANIFEST.MF file in the skywalking-agent.jar.
+         */
+        public static String VERSION = "";

Review Comment:
   The default value `UNKNOWN` can be moved here. 



##########
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/SnifferConfigInitializer.java:
##########
@@ -98,6 +103,9 @@ public static void initializeCoreConfig(String agentOptions) {
         configureLogger();
         LOGGER = LogManager.getLogger(SnifferConfigInitializer.class);
 
+        //set agent version

Review Comment:
   ```suggestion
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #437: Put `Agent-Version` property reading in premain stage to avoid deadlock when use `jarsigner`.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #437:
URL: https://github.com/apache/skywalking-java/pull/437#discussion_r1063306967


##########
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/SnifferConfigInitializer.java:
##########
@@ -202,6 +210,35 @@ private static void overrideConfigBySystemProp() {
         }
     }
 
+    /**
+     * Set agent version(Described in MANIFEST.MF)
+     */
+    private static void setAgentVersion() {
+        //set default value
+        Config.Agent.VERSION = "UNKNOWN";
+        try {
+            Enumeration<URL> resources = SnifferConfigInitializer.class.getClassLoader().getResources(JarFile.MANIFEST_NAME);
+            while (resources.hasMoreElements()) {
+                URL url = resources.nextElement();
+                LOGGER.info("SnifferConfigInitializer url:{}", url.toString());
+                try (InputStream is = url.openStream()) {
+                    if (is != null) {
+                        Manifest manifest = new Manifest(is);
+                        Attributes mainAttribs = manifest.getMainAttributes();
+                        String projectName = mainAttribs.getValue("Implementation-Vendor-Id");
+                        if (projectName != null) {
+                            if ("org.apache.skywalking".equals(projectName)) {
+                                Config.Agent.VERSION = mainAttribs.getValue("Implementation-Version");

Review Comment:
   This seems a legal issue from the beginning. Nice to add.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on pull request #437: Put `Agent-Version` property reading in premain stage to avoid deadlock when use `jarsigner`.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on PR #437:
URL: https://github.com/apache/skywalking-java/pull/437#issuecomment-1373209877

   Please make sure your codes could pass the style check, compiling and report the data as expected.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #437: Put `Agent-Version` property reading in premain stage to avoid deadlock when use `jarsigner`.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #437:
URL: https://github.com/apache/skywalking-java/pull/437#discussion_r1063172813


##########
CHANGES.md:
##########
@@ -24,6 +24,7 @@ Release Notes.
 * 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`.
+* Put `Agent-Version` property reading in premain stage to avoid deadlock when use `jarsigner`.

Review Comment:
   ```suggestion
   * Put `Agent-Version` property reading in the premain stage to avoid deadlock when using `jarsigner`.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #437: Put `Agent-Version` property reading in premain stage to avoid deadlock when use `jarsigner`.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #437:
URL: https://github.com/apache/skywalking-java/pull/437#discussion_r1063239485


##########
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/AgentIDDecorator.java:
##########
@@ -26,45 +26,17 @@
 import io.grpc.ForwardingClientCall;
 import io.grpc.Metadata;
 import io.grpc.MethodDescriptor;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-import org.apache.skywalking.apm.agent.core.logging.api.ILog;
-import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
+import org.apache.skywalking.apm.agent.core.conf.Config;
+
 
 /**
  * Add agent version(Described in MANIFEST.MF) to the connection establish stage.
  */
 public class AgentIDDecorator implements ChannelDecorator {
-    private static final ILog LOGGER = LogManager.getLogger(AgentIDDecorator.class);
     private static Metadata.Key<String> AGENT_VERSION_HEAD_HEADER_NAME;
-    private String version = "UNKNOWN";
 
     public AgentIDDecorator() {
-        try {
-            Enumeration<URL> resources = AgentIDDecorator.class.getClassLoader().getResources(JarFile.MANIFEST_NAME);
-            while (resources.hasMoreElements()) {
-                URL url = resources.nextElement();
-                try (InputStream is = url.openStream()) {
-                    if (is != null) {
-                        Manifest manifest = new Manifest(is);
-                        Attributes mainAttribs = manifest.getMainAttributes();
-                        String projectName = mainAttribs.getValue("Implementation-Vendor-Id");
-                        if (projectName != null) {
-                            if ("org.apache.skywalking".equals(projectName)) {
-                                version = mainAttribs.getValue("Implementation-Version");
-                            }
-                        }
-                    }
-                }
-            }
-            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");
-        }
+        AGENT_VERSION_HEAD_HEADER_NAME = Metadata.Key.of("Agent-Version", Metadata.ASCII_STRING_MARSHALLER);

Review Comment:
   This should move back to `static final`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #437: Put `Agent-Version` property reading in premain stage to avoid deadlock when use `jarsigner`.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #437:
URL: https://github.com/apache/skywalking-java/pull/437#discussion_r1063174807


##########
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/SnifferConfigInitializer.java:
##########
@@ -202,6 +206,37 @@ private static void overrideConfigBySystemProp() {
         }
     }
 
+    /**
+     * set agent version(Described in MANIFEST.MF)
+     *
+     * */

Review Comment:
   ```suggestion
       /**
        * Set agent version(Described in MANIFEST.MF)
        */
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] jinrongzhang commented on a diff in pull request #437: Put `Agent-Version` property reading in premain stage to avoid deadlock when use `jarsigner`.

Posted by GitBox <gi...@apache.org>.
jinrongzhang commented on code in PR #437:
URL: https://github.com/apache/skywalking-java/pull/437#discussion_r1063276049


##########
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/SnifferConfigInitializer.java:
##########
@@ -202,6 +210,36 @@ private static void overrideConfigBySystemProp() {
         }
     }
 
+    /**
+     * Set agent version(Described in MANIFEST.MF)
+     */
+    private static void setAgentVersion() {
+        //set default value
+        AGENT_SETTINGS.put("agent.version", "UNKNOWN");
+        try {
+            Enumeration<URL> resources = SnifferConfigInitializer.class.getClassLoader().getResources(JarFile.MANIFEST_NAME);
+            while (resources.hasMoreElements()) {
+                URL url = resources.nextElement();
+                LOGGER.info("SnifferConfigInitializer url:{}", url.toString());
+                try (InputStream is = url.openStream()) {
+                    if (is != null) {
+                        Manifest manifest = new Manifest(is);
+                        Attributes mainAttribs = manifest.getMainAttributes();
+                        String projectName = mainAttribs.getValue("Implementation-Vendor-Id");
+                        if (projectName != null) {
+                            if ("org.apache.skywalking".equals(projectName)) {
+                                String version = mainAttribs.getValue("Implementation-Version");
+                                AGENT_SETTINGS.put("agent.version", version);

Review Comment:
   You are right. there is really no need to do this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng merged pull request #437: Put `Agent-Version` property reading in premain stage to avoid deadlock when use `jarsigner`.

Posted by GitBox <gi...@apache.org>.
wu-sheng merged PR #437:
URL: https://github.com/apache/skywalking-java/pull/437


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org