You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "fsk119 (via GitHub)" <gi...@apache.org> on 2023/03/02 12:36:10 UTC

[GitHub] [flink] fsk119 opened a new pull request, #22072: [FLINK-31092][sql-gateway][table-common] Fix Hive ITCase fail with OutOfMemoryError

fsk119 opened a new pull request, #22072:
URL: https://github.com/apache/flink/pull/22072

   <!--
   *Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
     Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Azure Pipelines CI to do that following [this guide](https://cwiki.apache.org/confluence/display/FLINK/Azure+Pipelines#AzurePipelines-Tutorial:SettingupAzurePipelinesforaforkoftheFlinkrepository).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ## What is the purpose of the change
   
   *Fix test OOM in the Hive Module. There are two problems in the test:*
   *1. Gateway doesn't wait for all tasks finished before releasing the resources. This is because the `FutureTask#cancel`
   only interrupts the running worker but doesn't stop the thread.*
   *2. ServiceLoaderUtil keeps loading the results even though some unrelated exception happens.*
   
   
   ## Brief change log
   
   - *Commit f016d7c3 adds a case about a task that contains an infinite loop*
   - *Commit c888b066 fixes this problem by stopping the thread explicitly*
   - *Commit 63e97914 adds a case that `FactoryUtil` keeps loading results*
   - *Commit dc846d8b fixes the problem by checking the exception type*
   
   


-- 
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] XComp commented on a diff in pull request #22072: [FLINK-31092][sql-gateway][table-common] Fix Hive ITCase fail with OutOfMemoryError

Posted by "XComp (via GitHub)" <gi...@apache.org>.
XComp commented on code in PR #22072:
URL: https://github.com/apache/flink/pull/22072#discussion_r1123179109


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/ServiceLoaderUtil.java:
##########
@@ -44,6 +51,20 @@ static <T> List<LoadResult<T>> load(Class<T> clazz, ClassLoader classLoader) {
             } catch (NoSuchElementException e) {
                 break;
             } catch (Throwable t) {
+                if (t instanceof NoClassDefFoundError) {
+                    LOG.debug(
+                            "NoClassDefFoundError when loading a "
+                                    + clazz.getCanonicalName()
+                                    + ". This is expected when trying to load a format dependency but no flink-connector-files is loaded.",
+                            t);
+                    // After logging, we just ignore this failure
+                    continue;
+                }
+
+                if (!clazz.isInstance(t)) {

Review Comment:
   imho, this if condition still doesn't make sense. And the error handling should probably live in the calling method `FactoryUtil.discoverFactories`. `ServiceLoaderUtil.load` seems to be more general. I provided a commit show what I had in mind in [42453004](https://github.com/fsk119/flink/pull/1/commits/42453004898473a6e28b78f7603b30c3b1e24951) in [PR fsk119/flink:#1](https://github.com/fsk119/flink/pull/1/). But we could even go one step further and delete `ServiceLoaderUtil` completely. imho, it doesn't add much value to the codebase as it's only called in `FactoryUtil.discoverFactories`.
   
   But see [PR fsk119/flink:#1](https://github.com/fsk119/flink/pull/1/) more like a suggestion. ...it's your call.



-- 
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] fsk119 commented on pull request #22072: [FLINK-31092][sql-gateway][table-common] Fix Hive ITCase fail with OutOfMemoryError

Posted by "fsk119 (via GitHub)" <gi...@apache.org>.
fsk119 commented on PR #22072:
URL: https://github.com/apache/flink/pull/22072#issuecomment-1453011294

   I have verify the sql-gateway module in the jdk11 environment with command
   
   ```
   mvn clean verify -Pjava11
   ```
   
   and all tests pass.


-- 
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] fsk119 commented on pull request #22072: [FLINK-31092][sql-gateway][table-common] Fix Hive ITCase fail with OutOfMemoryError

Posted by "fsk119 (via GitHub)" <gi...@apache.org>.
fsk119 commented on PR #22072:
URL: https://github.com/apache/flink/pull/22072#issuecomment-1453063763

   All tests pass in my pipeline: https://dev.azure.com/1059623455/Flink/_build/results?buildId=565&view=results


-- 
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] XComp commented on a diff in pull request #22072: [FLINK-31092][sql-gateway][table-common] Fix Hive ITCase fail with OutOfMemoryError

Posted by "XComp (via GitHub)" <gi...@apache.org>.
XComp commented on code in PR #22072:
URL: https://github.com/apache/flink/pull/22072#discussion_r1123179109


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/ServiceLoaderUtil.java:
##########
@@ -44,6 +51,20 @@ static <T> List<LoadResult<T>> load(Class<T> clazz, ClassLoader classLoader) {
             } catch (NoSuchElementException e) {
                 break;
             } catch (Throwable t) {
+                if (t instanceof NoClassDefFoundError) {
+                    LOG.debug(
+                            "NoClassDefFoundError when loading a "
+                                    + clazz.getCanonicalName()
+                                    + ". This is expected when trying to load a format dependency but no flink-connector-files is loaded.",
+                            t);
+                    // After logging, we just ignore this failure
+                    continue;
+                }
+
+                if (!clazz.isInstance(t)) {

Review Comment:
   imho, this if condition still doesn't make sense. And the error handling should probably live in the calling method `FactoryUtil.discoverFactories`. `ServiceLoaderUtil.load` seems to be more general. I provided a commit to show what I had in mind: [42453004](https://github.com/fsk119/flink/pull/1/commits/42453004898473a6e28b78f7603b30c3b1e24951) in [PR fsk119/flink:#1](https://github.com/fsk119/flink/pull/1/). But we could even go one step further and delete `ServiceLoaderUtil` completely. imho, it doesn't add much value to the codebase as it's only called in `FactoryUtil.discoverFactories`.
   
   But see [PR fsk119/flink:#1](https://github.com/fsk119/flink/pull/1/) more like a suggestion. ...it's your call.



-- 
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] fsk119 closed pull request #22072: [FLINK-31092][sql-gateway][table-common] Fix Hive ITCase fail with OutOfMemoryError

Posted by "fsk119 (via GitHub)" <gi...@apache.org>.
fsk119 closed pull request #22072: [FLINK-31092][sql-gateway][table-common] Fix Hive ITCase fail with OutOfMemoryError
URL: https://github.com/apache/flink/pull/22072


-- 
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] flinkbot commented on pull request #22072: [FLINK-31092][sql-gateway][table-common] Fix Hive ITCase fail with OutOfMemoryError

Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #22072:
URL: https://github.com/apache/flink/pull/22072#issuecomment-1451813802

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dc846d8bf7022b8993d08bf8f63dff4eda5032a0",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "dc846d8bf7022b8993d08bf8f63dff4eda5032a0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * dc846d8bf7022b8993d08bf8f63dff4eda5032a0 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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