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 2020/02/07 11:59:08 UTC

[GitHub] [skywalking] kezhenxu94 opened a new pull request #4325: Close leaked I/O stream and remove unused codes

kezhenxu94 opened a new pull request #4325: Close leaked I/O stream and remove unused codes
URL: https://github.com/apache/skywalking/pull/4325
 
 
   ### Motivation:
   
   Clean up unused codes and migrate to JDK8.
   
   ### Modifications:
   
   - Remove unused codes.
   
   - Close leaked I/O stream.
   
   - Remove meaningless comments.
   
   - Other miscellaneous changes.
   
   ### Result:
   
   - No unnecessary codes concerns.
   
   - No resources leak.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] kezhenxu94 merged pull request #4325: Close leaked I/O stream and remove unused codes

Posted by GitBox <gi...@apache.org>.
kezhenxu94 merged pull request #4325: Close leaked I/O stream and remove unused codes
URL: https://github.com/apache/skywalking/pull/4325
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on issue #4325: Close leaked I/O stream and remove unused codes

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4325: Close leaked I/O stream and remove unused codes
URL: https://github.com/apache/skywalking/pull/4325#issuecomment-583363484
 
 
   Some wrong change? All tests are falling.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4325: Close leaked I/O stream and remove unused codes

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4325: Close leaked I/O stream and remove unused codes
URL: https://github.com/apache/skywalking/pull/4325#discussion_r376367341
 
 

 ##########
 File path: apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/loader/AgentClassLoader.java
 ##########
 @@ -62,34 +61,22 @@
     private ReentrantLock jarScanLock = new ReentrantLock();
 
     /**
-     * Functional Description: solve the classloader dead lock when jvm start
-     * only support JDK7+, since ParallelCapable appears in JDK7+
+     * Try to solve the classloader dead lock.
+     *
+     * @see <a href="https://github.com/apache/skywalking/pull/2016">#2016</a>
      */
     private static void tryRegisterAsParallelCapable() {
-        Method[] methods = ClassLoader.class.getDeclaredMethods();
-        for (int i = 0; i < methods.length; i++) {
-            Method method = methods[i];
-            String methodName = method.getName();
-            if ("registerAsParallelCapable".equalsIgnoreCase(methodName)) {
-                try {
-                    method.setAccessible(true);
-                    method.invoke(null);
-                } catch (Exception e) {
-                    logger.warn(e, "can not invoke ClassLoader.registerAsParallelCapable()");
-                }
-                return;
-            }
-        }
+        registerAsParallelCapable();
 
 Review comment:
   You should delete this method, and move `registerAsParallelCapable` to the static initial block.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] arugal commented on issue #4325: Close leaked I/O stream and remove unused codes

Posted by GitBox <gi...@apache.org>.
arugal commented on issue #4325: Close leaked I/O stream and remove unused codes
URL: https://github.com/apache/skywalking/pull/4325#issuecomment-583372408
 
 
   This is also unused code.
   https://github.com/apache/skywalking/blob/e44bc36281cc0c79f263906464c62698bbf5959d/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/TraceSegmentServiceClient.java#L48

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] kezhenxu94 commented on issue #4325: Close leaked I/O stream and remove unused codes

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on issue #4325: Close leaked I/O stream and remove unused codes
URL: https://github.com/apache/skywalking/pull/4325#issuecomment-583374609
 
 
   > This is also unused code.
   > 
   > https://github.com/apache/skywalking/blob/e44bc36281cc0c79f263906464c62698bbf5959d/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/TraceSegmentServiceClient.java#L48
   
   I don't know whether you've read the changed files or not, it's already removed in the very first commit in this PR

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services