You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/05/17 06:34:56 UTC

[GitHub] [flink] paul8263 opened a new pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

paul8263 opened a new pull request #15927:
URL: https://github.com/apache/flink/pull/15927


   ## What is the purpose of the change
   
   Fixed missing classloader URL when using ClassLoaderUtil.getUserCodeClassLoaderInfo to retrieve the info of SafetyNetWrapperClassLoader.
   
   ## Brief change log
   
     - Added overridden getURLs method in SafetyNetWrapperClassLoader
     - Added corresponding unit tests
     - Refactored getUserCodeClassLoaderInfo in ClassLoaderUtil, by extracting the URL formatting logic to an independent method.
   
   ## Verifying this change
   
   This change is already covered by existing tests, such as:
   
    - FlinkUserCodeClassLoadersTest.testGetClassLoaderInfo
    - FlinkUserCodeClassLoadersTest.testGetClassLoaderInfoWithClassLoaderClosed
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
   


-- 
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



[GitHub] [flink] paul8263 commented on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
paul8263 commented on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-845588698


   @zentol I think there might not be necessary to ensure that the classloader is closed so I kept it the same as other test cases.
   Also I noticed the method `createChildFirstClassLoader` already exists in `FlinkUserCodeClassLoadersTest`. I used it to keep the code clean. Is there anything else I can help?


-- 
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



[GitHub] [flink] paul8263 commented on a change in pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
paul8263 commented on a change in pull request #15927:
URL: https://github.com/apache/flink/pull/15927#discussion_r638417384



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/FlinkUserCodeClassLoadersTest.java
##########
@@ -208,6 +212,50 @@ public void testRepeatedParentFirstPatternClass() throws Exception {
         childClassLoader.close();
     }
 
+    @Test
+    public void testGetClassLoaderInfo() throws Exception {
+        final ClassLoader parentClassLoader = getClass().getClassLoader();
+
+        final URL childCodePath = getClass().getProtectionDomain().getCodeSource().getLocation();
+
+        final URLClassLoader childClassLoader =
+                FlinkUserCodeClassLoaders.childFirst(
+                        new URL[] {childCodePath},
+                        parentClassLoader,
+                        new String[] {},
+                        NOOP_EXCEPTION_HANDLER,
+                        true);
+
+        String formattedURL = ClassLoaderUtil.formatURL(childCodePath);
+
+        assertEquals(
+                ClassLoaderUtil.getUserCodeClassLoaderInfo(childClassLoader),
+                "URL ClassLoader:" + formattedURL);
+
+        childClassLoader.close();

Review comment:
       I think  there is no need to ensure it is closed. So I keep it the same as other test cases.




-- 
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



[GitHub] [flink] flinkbot edited a comment on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-842043965


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit c92770317d4c844d26f06a885b84fb6ab5c052d9 (Sat Aug 28 12:12:23 UTC 2021)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

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



[GitHub] [flink] paul8263 commented on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
paul8263 commented on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-844635880


   Thank you @zentol . I reworked those codes in ce1bf53 .


-- 
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



[GitHub] [flink] flinkbot edited a comment on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-842054909


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18012",
       "triggerID" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18112",
       "triggerID" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 98e2ad667f5990ce96f7421ca6077ead095354d2 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18012) 
   * 760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18112) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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



[GitHub] [flink] flinkbot commented on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-842043965


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit 98e2ad667f5990ce96f7421ca6077ead095354d2 (Mon May 17 06:38:16 UTC 2021)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
    * **This pull request references an unassigned [Jira ticket](https://issues.apache.org/jira/browse/FLINK-22639).** According to the [code contribution guide](https://flink.apache.org/contributing/contribute-code.html), tickets need to be assigned before starting with the implementation work.
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


-- 
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



[GitHub] [flink] flinkbot edited a comment on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-842054909


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18012",
       "triggerID" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18112",
       "triggerID" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ce1bf535ffd28ea2b7fc10264a184f05e8980aed",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18160",
       "triggerID" : "ce1bf535ffd28ea2b7fc10264a184f05e8980aed",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c92770317d4c844d26f06a885b84fb6ab5c052d9",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c92770317d4c844d26f06a885b84fb6ab5c052d9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ce1bf535ffd28ea2b7fc10264a184f05e8980aed Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18160) 
   * c92770317d4c844d26f06a885b84fb6ab5c052d9 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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



[GitHub] [flink] flinkbot edited a comment on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-842054909


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18012",
       "triggerID" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18112",
       "triggerID" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ce1bf535ffd28ea2b7fc10264a184f05e8980aed",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ce1bf535ffd28ea2b7fc10264a184f05e8980aed",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18112) 
   * ce1bf535ffd28ea2b7fc10264a184f05e8980aed UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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



[GitHub] [flink] flinkbot edited a comment on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-842054909


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18012",
       "triggerID" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18112",
       "triggerID" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ce1bf535ffd28ea2b7fc10264a184f05e8980aed",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18160",
       "triggerID" : "ce1bf535ffd28ea2b7fc10264a184f05e8980aed",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18112) 
   * ce1bf535ffd28ea2b7fc10264a184f05e8980aed Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18160) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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



[GitHub] [flink] zentol commented on a change in pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
zentol commented on a change in pull request #15927:
URL: https://github.com/apache/flink/pull/15927#discussion_r635086541



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/FlinkUserCodeClassLoadersTest.java
##########
@@ -208,6 +212,64 @@ public void testRepeatedParentFirstPatternClass() throws Exception {
         childClassLoader.close();
     }
 
+    @Test
+    public void testGetClassLoaderInfo() {
+        final String className = FlinkUserCodeClassLoadersTest.class.getName();
+        final String parentFirstPattern = className.substring(0, className.lastIndexOf('.'));
+
+        final ClassLoader parentClassLoader = getClass().getClassLoader();
+
+        final URL childCodePath = getClass().getProtectionDomain().getCodeSource().getLocation();
+
+        final URLClassLoader childClassLoader =
+                FlinkUserCodeClassLoaders.childFirst(
+                        new URL[] {childCodePath},
+                        parentClassLoader,
+                        new String[] {parentFirstPattern},
+                        NOOP_EXCEPTION_HANDLER,
+                        true);
+
+        String formattedURL = null;
+        try {
+            formattedURL = ClassLoaderUtil.formatURL(childCodePath);
+        } catch (IOException e) {
+            // Should not fail here
+            fail();
+        }

Review comment:
       ```suggestion
           String formattedURL = ClassLoaderUtil.formatURL(childCodePath);
   ```
   Let the exception bubble up

##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/FlinkUserCodeClassLoadersTest.java
##########
@@ -208,6 +212,64 @@ public void testRepeatedParentFirstPatternClass() throws Exception {
         childClassLoader.close();
     }
 
+    @Test
+    public void testGetClassLoaderInfo() {
+        final String className = FlinkUserCodeClassLoadersTest.class.getName();
+        final String parentFirstPattern = className.substring(0, className.lastIndexOf('.'));

Review comment:
       why is this necessary?

##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/FlinkUserCodeClassLoadersTest.java
##########
@@ -208,6 +212,64 @@ public void testRepeatedParentFirstPatternClass() throws Exception {
         childClassLoader.close();
     }
 
+    @Test
+    public void testGetClassLoaderInfo() {
+        final String className = FlinkUserCodeClassLoadersTest.class.getName();
+        final String parentFirstPattern = className.substring(0, className.lastIndexOf('.'));
+
+        final ClassLoader parentClassLoader = getClass().getClassLoader();
+
+        final URL childCodePath = getClass().getProtectionDomain().getCodeSource().getLocation();
+
+        final URLClassLoader childClassLoader =
+                FlinkUserCodeClassLoaders.childFirst(
+                        new URL[] {childCodePath},
+                        parentClassLoader,
+                        new String[] {parentFirstPattern},
+                        NOOP_EXCEPTION_HANDLER,
+                        true);
+
+        String formattedURL = null;
+        try {
+            formattedURL = ClassLoaderUtil.formatURL(childCodePath);
+        } catch (IOException e) {
+            // Should not fail here
+            fail();
+        }
+
+        assertEquals(
+                ClassLoaderUtil.getUserCodeClassLoaderInfo(childClassLoader),
+                "URL ClassLoader:" + formattedURL);
+    }
+
+    @Test
+    public void testGetClassLoaderInfoWithClassLoaderClosed() {
+        final String className = FlinkUserCodeClassLoadersTest.class.getName();
+        final String parentFirstPattern = className.substring(0, className.lastIndexOf('.'));
+
+        final ClassLoader parentClassLoader = getClass().getClassLoader();
+
+        final URL childCodePath = getClass().getProtectionDomain().getCodeSource().getLocation();
+
+        final URLClassLoader childClassLoader =
+                FlinkUserCodeClassLoaders.childFirst(
+                        new URL[] {childCodePath},
+                        parentClassLoader,
+                        new String[] {parentFirstPattern},
+                        NOOP_EXCEPTION_HANDLER,
+                        true);
+
+        try {
+            childClassLoader.close();
+        } catch (IOException e) {
+            fail("Cannot close child classloader");
+        }

Review comment:
       same as above

##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/FlinkUserCodeClassLoadersTest.java
##########
@@ -208,6 +212,64 @@ public void testRepeatedParentFirstPatternClass() throws Exception {
         childClassLoader.close();
     }
 
+    @Test
+    public void testGetClassLoaderInfo() {
+        final String className = FlinkUserCodeClassLoadersTest.class.getName();
+        final String parentFirstPattern = className.substring(0, className.lastIndexOf('.'));
+
+        final ClassLoader parentClassLoader = getClass().getClassLoader();
+
+        final URL childCodePath = getClass().getProtectionDomain().getCodeSource().getLocation();
+
+        final URLClassLoader childClassLoader =
+                FlinkUserCodeClassLoaders.childFirst(
+                        new URL[] {childCodePath},
+                        parentClassLoader,
+                        new String[] {parentFirstPattern},
+                        NOOP_EXCEPTION_HANDLER,
+                        true);
+
+        String formattedURL = null;
+        try {
+            formattedURL = ClassLoaderUtil.formatURL(childCodePath);
+        } catch (IOException e) {
+            // Should not fail here
+            fail();
+        }
+
+        assertEquals(
+                ClassLoaderUtil.getUserCodeClassLoaderInfo(childClassLoader),
+                "URL ClassLoader:" + formattedURL);
+    }
+
+    @Test
+    public void testGetClassLoaderInfoWithClassLoaderClosed() {
+        final String className = FlinkUserCodeClassLoadersTest.class.getName();
+        final String parentFirstPattern = className.substring(0, className.lastIndexOf('.'));
+
+        final ClassLoader parentClassLoader = getClass().getClassLoader();
+
+        final URL childCodePath = getClass().getProtectionDomain().getCodeSource().getLocation();
+
+        final URLClassLoader childClassLoader =
+                FlinkUserCodeClassLoaders.childFirst(
+                        new URL[] {childCodePath},
+                        parentClassLoader,
+                        new String[] {parentFirstPattern},
+                        NOOP_EXCEPTION_HANDLER,
+                        true);
+
+        try {
+            childClassLoader.close();
+        } catch (IOException e) {
+            fail("Cannot close child classloader");
+        }
+
+        assertTrue(
+                ClassLoaderUtil.getUserCodeClassLoaderInfo(childClassLoader)
+                        .startsWith("Cannot access classloader info due to an exception."));

Review comment:
       use hamcrest matcher instead; assertThat(...).(StringStartsWith.startsWith(...); it provides much better error messages




-- 
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



[GitHub] [flink] flinkbot commented on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-842054909


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 98e2ad667f5990ce96f7421ca6077ead095354d2 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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



[GitHub] [flink] flinkbot edited a comment on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-842054909


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18012",
       "triggerID" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 98e2ad667f5990ce96f7421ca6077ead095354d2 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18012) 
   * 760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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



[GitHub] [flink] flinkbot edited a comment on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-842054909


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18012",
       "triggerID" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 98e2ad667f5990ce96f7421ca6077ead095354d2 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18012) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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



[GitHub] [flink] paul8263 commented on a change in pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
paul8263 commented on a change in pull request #15927:
URL: https://github.com/apache/flink/pull/15927#discussion_r638418219



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/FlinkUserCodeClassLoadersTest.java
##########
@@ -208,6 +212,64 @@ public void testRepeatedParentFirstPatternClass() throws Exception {
         childClassLoader.close();
     }
 
+    @Test
+    public void testGetClassLoaderInfo() {
+        final String className = FlinkUserCodeClassLoadersTest.class.getName();
+        final String parentFirstPattern = className.substring(0, className.lastIndexOf('.'));
+
+        final ClassLoader parentClassLoader = getClass().getClassLoader();
+
+        final URL childCodePath = getClass().getProtectionDomain().getCodeSource().getLocation();
+
+        final URLClassLoader childClassLoader =
+                FlinkUserCodeClassLoaders.childFirst(
+                        new URL[] {childCodePath},
+                        parentClassLoader,
+                        new String[] {parentFirstPattern},
+                        NOOP_EXCEPTION_HANDLER,
+                        true);
+
+        String formattedURL = null;
+        try {
+            formattedURL = ClassLoaderUtil.formatURL(childCodePath);
+        } catch (IOException e) {
+            // Should not fail here
+            fail();
+        }

Review comment:
       It was fixed in  c927703




-- 
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



[GitHub] [flink] flinkbot commented on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-842043965






-- 
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



[GitHub] [flink] paul8263 commented on a change in pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
paul8263 commented on a change in pull request #15927:
URL: https://github.com/apache/flink/pull/15927#discussion_r638417597



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/FlinkUserCodeClassLoadersTest.java
##########
@@ -208,6 +212,50 @@ public void testRepeatedParentFirstPatternClass() throws Exception {
         childClassLoader.close();
     }
 
+    @Test
+    public void testGetClassLoaderInfo() throws Exception {
+        final ClassLoader parentClassLoader = getClass().getClassLoader();
+
+        final URL childCodePath = getClass().getProtectionDomain().getCodeSource().getLocation();
+
+        final URLClassLoader childClassLoader =
+                FlinkUserCodeClassLoaders.childFirst(
+                        new URL[] {childCodePath},
+                        parentClassLoader,
+                        new String[] {},
+                        NOOP_EXCEPTION_HANDLER,
+                        true);
+
+        String formattedURL = ClassLoaderUtil.formatURL(childCodePath);
+
+        assertEquals(
+                ClassLoaderUtil.getUserCodeClassLoaderInfo(childClassLoader),
+                "URL ClassLoader:" + formattedURL);
+
+        childClassLoader.close();
+    }
+
+    @Test
+    public void testGetClassLoaderInfoWithClassLoaderClosed() throws Exception {
+        final ClassLoader parentClassLoader = getClass().getClassLoader();
+
+        final URL childCodePath = getClass().getProtectionDomain().getCodeSource().getLocation();
+
+        final URLClassLoader childClassLoader =
+                FlinkUserCodeClassLoaders.childFirst(
+                        new URL[] {childCodePath},
+                        parentClassLoader,
+                        new String[] {},
+                        NOOP_EXCEPTION_HANDLER,
+                        true);
+
+        childClassLoader.close();
+
+        assertThat(
+                ClassLoaderUtil.getUserCodeClassLoaderInfo(childClassLoader),
+                is(startsWith("Cannot access classloader info due to an exception.")));

Review comment:
       It was fixed in  c927703




-- 
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



[GitHub] [flink] flinkbot edited a comment on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-842054909


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18012",
       "triggerID" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18112",
       "triggerID" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ce1bf535ffd28ea2b7fc10264a184f05e8980aed",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18160",
       "triggerID" : "ce1bf535ffd28ea2b7fc10264a184f05e8980aed",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c92770317d4c844d26f06a885b84fb6ab5c052d9",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18212",
       "triggerID" : "c92770317d4c844d26f06a885b84fb6ab5c052d9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c92770317d4c844d26f06a885b84fb6ab5c052d9 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18212) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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



[GitHub] [flink] flinkbot edited a comment on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-842054909


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18012",
       "triggerID" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18112",
       "triggerID" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ce1bf535ffd28ea2b7fc10264a184f05e8980aed",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18160",
       "triggerID" : "ce1bf535ffd28ea2b7fc10264a184f05e8980aed",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c92770317d4c844d26f06a885b84fb6ab5c052d9",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18212",
       "triggerID" : "c92770317d4c844d26f06a885b84fb6ab5c052d9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ce1bf535ffd28ea2b7fc10264a184f05e8980aed Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18160) 
   * c92770317d4c844d26f06a885b84fb6ab5c052d9 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18212) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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



[GitHub] [flink] flinkbot edited a comment on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-842054909


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18012",
       "triggerID" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 98e2ad667f5990ce96f7421ca6077ead095354d2 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18012) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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



[GitHub] [flink] flinkbot edited a comment on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-842054909


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18012",
       "triggerID" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18112",
       "triggerID" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ce1bf535ffd28ea2b7fc10264a184f05e8980aed",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18160",
       "triggerID" : "ce1bf535ffd28ea2b7fc10264a184f05e8980aed",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ce1bf535ffd28ea2b7fc10264a184f05e8980aed Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18160) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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



[GitHub] [flink] zentol commented on a change in pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
zentol commented on a change in pull request #15927:
URL: https://github.com/apache/flink/pull/15927#discussion_r635900027



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/FlinkUserCodeClassLoadersTest.java
##########
@@ -208,6 +212,50 @@ public void testRepeatedParentFirstPatternClass() throws Exception {
         childClassLoader.close();
     }
 
+    @Test
+    public void testGetClassLoaderInfo() throws Exception {
+        final ClassLoader parentClassLoader = getClass().getClassLoader();
+
+        final URL childCodePath = getClass().getProtectionDomain().getCodeSource().getLocation();
+
+        final URLClassLoader childClassLoader =
+                FlinkUserCodeClassLoaders.childFirst(
+                        new URL[] {childCodePath},
+                        parentClassLoader,
+                        new String[] {},
+                        NOOP_EXCEPTION_HANDLER,
+                        true);
+
+        String formattedURL = ClassLoaderUtil.formatURL(childCodePath);
+
+        assertEquals(
+                ClassLoaderUtil.getUserCodeClassLoaderInfo(childClassLoader),
+                "URL ClassLoader:" + formattedURL);
+
+        childClassLoader.close();
+    }
+
+    @Test
+    public void testGetClassLoaderInfoWithClassLoaderClosed() throws Exception {
+        final ClassLoader parentClassLoader = getClass().getClassLoader();
+
+        final URL childCodePath = getClass().getProtectionDomain().getCodeSource().getLocation();
+
+        final URLClassLoader childClassLoader =
+                FlinkUserCodeClassLoaders.childFirst(
+                        new URL[] {childCodePath},
+                        parentClassLoader,
+                        new String[] {},
+                        NOOP_EXCEPTION_HANDLER,
+                        true);
+
+        childClassLoader.close();
+
+        assertThat(
+                ClassLoaderUtil.getUserCodeClassLoaderInfo(childClassLoader),
+                is(startsWith("Cannot access classloader info due to an exception.")));

Review comment:
       ```suggestion
                   startsWith("Cannot access classloader info due to an exception."));
   ```
   I would think that `is` isn't necessary.

##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/FlinkUserCodeClassLoadersTest.java
##########
@@ -208,6 +212,50 @@ public void testRepeatedParentFirstPatternClass() throws Exception {
         childClassLoader.close();
     }
 
+    @Test
+    public void testGetClassLoaderInfo() throws Exception {
+        final ClassLoader parentClassLoader = getClass().getClassLoader();
+
+        final URL childCodePath = getClass().getProtectionDomain().getCodeSource().getLocation();
+
+        final URLClassLoader childClassLoader =
+                FlinkUserCodeClassLoaders.childFirst(
+                        new URL[] {childCodePath},
+                        parentClassLoader,
+                        new String[] {},
+                        NOOP_EXCEPTION_HANDLER,
+                        true);
+
+        String formattedURL = ClassLoaderUtil.formatURL(childCodePath);
+
+        assertEquals(
+                ClassLoaderUtil.getUserCodeClassLoaderInfo(childClassLoader),
+                "URL ClassLoader:" + formattedURL);
+
+        childClassLoader.close();

Review comment:
       if you want to ensure that this CL is closed then you should use a finally block to ensure it is closed if the test fails




-- 
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



[GitHub] [flink] paul8263 commented on a change in pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
paul8263 commented on a change in pull request #15927:
URL: https://github.com/apache/flink/pull/15927#discussion_r638418295



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/FlinkUserCodeClassLoadersTest.java
##########
@@ -208,6 +212,64 @@ public void testRepeatedParentFirstPatternClass() throws Exception {
         childClassLoader.close();
     }
 
+    @Test
+    public void testGetClassLoaderInfo() {
+        final String className = FlinkUserCodeClassLoadersTest.class.getName();
+        final String parentFirstPattern = className.substring(0, className.lastIndexOf('.'));
+
+        final ClassLoader parentClassLoader = getClass().getClassLoader();
+
+        final URL childCodePath = getClass().getProtectionDomain().getCodeSource().getLocation();
+
+        final URLClassLoader childClassLoader =
+                FlinkUserCodeClassLoaders.childFirst(
+                        new URL[] {childCodePath},
+                        parentClassLoader,
+                        new String[] {parentFirstPattern},
+                        NOOP_EXCEPTION_HANDLER,
+                        true);
+
+        String formattedURL = null;
+        try {
+            formattedURL = ClassLoaderUtil.formatURL(childCodePath);
+        } catch (IOException e) {
+            // Should not fail here
+            fail();
+        }
+
+        assertEquals(
+                ClassLoaderUtil.getUserCodeClassLoaderInfo(childClassLoader),
+                "URL ClassLoader:" + formattedURL);
+    }
+
+    @Test
+    public void testGetClassLoaderInfoWithClassLoaderClosed() {
+        final String className = FlinkUserCodeClassLoadersTest.class.getName();
+        final String parentFirstPattern = className.substring(0, className.lastIndexOf('.'));
+
+        final ClassLoader parentClassLoader = getClass().getClassLoader();
+
+        final URL childCodePath = getClass().getProtectionDomain().getCodeSource().getLocation();
+
+        final URLClassLoader childClassLoader =
+                FlinkUserCodeClassLoaders.childFirst(
+                        new URL[] {childCodePath},
+                        parentClassLoader,
+                        new String[] {parentFirstPattern},
+                        NOOP_EXCEPTION_HANDLER,
+                        true);
+
+        try {
+            childClassLoader.close();
+        } catch (IOException e) {
+            fail("Cannot close child classloader");
+        }

Review comment:
       It was fixed in c927703




-- 
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



[GitHub] [flink] flinkbot edited a comment on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-842054909


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18012",
       "triggerID" : "98e2ad667f5990ce96f7421ca6077ead095354d2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18112",
       "triggerID" : "760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 760d7a3b2f4d2cc87871f228316f1f2bf70fe8ae Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18112) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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



[GitHub] [flink] zentol merged pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
zentol merged pull request #15927:
URL: https://github.com/apache/flink/pull/15927


   


-- 
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



[GitHub] [flink] paul8263 commented on pull request #15927: [FLINK-22639][runtime] ClassLoaderUtil cannot print classpath of Flin…

Posted by GitBox <gi...@apache.org>.
paul8263 commented on pull request #15927:
URL: https://github.com/apache/flink/pull/15927#issuecomment-843661184


   I noticed that there were several code format issues and those were fixed in 760d7a3.


-- 
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