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 2020/04/13 15:27:40 UTC

[GitHub] [flink] HuangXingBo opened a new pull request #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.

HuangXingBo opened a new pull request #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719
 
 
   ## What is the purpose of the change
   
   *This pull request makes task deployment go through the blob server, rather than through RPC. That way we avoid re-transferring them on each deployment (during recovery).)*
   
   
   ## Brief change log
   
     - *disable the launching of gateway server to prevent from dead loop in ProcessPythonEnvironmentManager*
   
   ## Verifying this change
   
     - *test_set_environment*
   
   ## 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)
     - If yes, how is the feature documented? (not applicable)
   

----------------------------------------------------------------
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] [flink] flinkbot edited a comment on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719#issuecomment-612955433
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7410",
       "triggerID" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "triggerType" : "PUSH"
     }, {
       "hash" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/160069032",
       "triggerID" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/160069032) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7410) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719#issuecomment-612955433
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7410",
       "triggerID" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "triggerType" : "PUSH"
     }, {
       "hash" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/160069032",
       "triggerID" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3217fe626768708cf04bc7b3b0aa81b9c184d0f4",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "3217fe626768708cf04bc7b3b0aa81b9c184d0f4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/160069032) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7410) 
   * 3217fe626768708cf04bc7b3b0aa81b9c184d0f4 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


With regards,
Apache Git Services

[GitHub] [flink] dianfu commented on a change in pull request #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.

Posted by GitBox <gi...@apache.org>.
dianfu commented on a change in pull request #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719#discussion_r407837618
 
 

 ##########
 File path: flink-python/pyflink/java_gateway.py
 ##########
 @@ -34,6 +34,14 @@
 _lock = RLock()
 
 
+def is_launch_java_gateway_disabled():
 
 Review comment:
   Rename to is_launch_gateway_disabled

----------------------------------------------------------------
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] [flink] flinkbot edited a comment on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719#issuecomment-612955433
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7410",
       "triggerID" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "triggerType" : "PUSH"
     }, {
       "hash" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/160069032",
       "triggerID" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3217fe626768708cf04bc7b3b0aa81b9c184d0f4",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/160156438",
       "triggerID" : "3217fe626768708cf04bc7b3b0aa81b9c184d0f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3217fe626768708cf04bc7b3b0aa81b9c184d0f4",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7429",
       "triggerID" : "3217fe626768708cf04bc7b3b0aa81b9c184d0f4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/160069032) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7410) 
   * 3217fe626768708cf04bc7b3b0aa81b9c184d0f4 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/160156438) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7429) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719#issuecomment-612955433
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7410",
       "triggerID" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "triggerType" : "PUSH"
     }, {
       "hash" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/160069032",
       "triggerID" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/160069032) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7410) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719#issuecomment-612955433
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7410",
       "triggerID" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "triggerType" : "PUSH"
     }, {
       "hash" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/160069032",
       "triggerID" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3217fe626768708cf04bc7b3b0aa81b9c184d0f4",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/160156438",
       "triggerID" : "3217fe626768708cf04bc7b3b0aa81b9c184d0f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3217fe626768708cf04bc7b3b0aa81b9c184d0f4",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7429",
       "triggerID" : "3217fe626768708cf04bc7b3b0aa81b9c184d0f4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3217fe626768708cf04bc7b3b0aa81b9c184d0f4 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/160156438) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7429) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719#issuecomment-612955433
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7410",
       "triggerID" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "triggerType" : "PUSH"
     }, {
       "hash" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/160069032",
       "triggerID" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3217fe626768708cf04bc7b3b0aa81b9c184d0f4",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/160156438",
       "triggerID" : "3217fe626768708cf04bc7b3b0aa81b9c184d0f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3217fe626768708cf04bc7b3b0aa81b9c184d0f4",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7429",
       "triggerID" : "3217fe626768708cf04bc7b3b0aa81b9c184d0f4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3217fe626768708cf04bc7b3b0aa81b9c184d0f4 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/160156438) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7429) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot commented on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719#issuecomment-612948966
 
 
   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 da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50 (Mon Apr 13 15:29:40 UTC 2020)
   
   **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-17124).** 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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719#issuecomment-612955433
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7410",
       "triggerID" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "triggerType" : "PUSH"
     }, {
       "hash" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/160069032",
       "triggerID" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/160069032) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7410) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] dianfu commented on a change in pull request #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.

Posted by GitBox <gi...@apache.org>.
dianfu commented on a change in pull request #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719#discussion_r407833239
 
 

 ##########
 File path: flink-python/pyflink/table/tests/test_dependency.py
 ##########
 @@ -196,11 +196,28 @@ def check_python_exec(i):
         self.t_env.register_function("check_python_exec",
                                      udf(check_python_exec, DataTypes.BIGINT(),
                                          DataTypes.BIGINT()))
+
+        def check_pyflink_gateway_disabled(i):
+            try:
+                from pyflink.java_gateway import get_gateway
+                get_gateway()
+            except Exception as e:
 
 Review comment:
   Use assertRaisesRegex? Could refer to test_pandas_udf.test_non_exist_udf_type for more details on how to use assertRaisesRegex.

----------------------------------------------------------------
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] [flink] dianfu commented on a change in pull request #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.

Posted by GitBox <gi...@apache.org>.
dianfu commented on a change in pull request #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719#discussion_r407833239
 
 

 ##########
 File path: flink-python/pyflink/table/tests/test_dependency.py
 ##########
 @@ -196,11 +196,28 @@ def check_python_exec(i):
         self.t_env.register_function("check_python_exec",
                                      udf(check_python_exec, DataTypes.BIGINT(),
                                          DataTypes.BIGINT()))
+
+        def check_pyflink_gateway_disabled(i):
+            try:
+                from pyflink.java_gateway import get_gateway
+                get_gateway()
+            except Exception as e:
 
 Review comment:
   Use assertRaisesRegex? Could refer to test_pandas_udf.test_non_exist_udf_type for more details on how to use assertRaisesRegex.

----------------------------------------------------------------
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] [flink] dianfu commented on a change in pull request #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.

Posted by GitBox <gi...@apache.org>.
dianfu commented on a change in pull request #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719#discussion_r407837285
 
 

 ##########
 File path: flink-python/pyflink/java_gateway.py
 ##########
 @@ -59,7 +67,10 @@ def launch_gateway():
     """
     launch jvm gateway
     """
-
+    if is_launch_java_gateway_disabled():
+        raise Exception("Launching java gateway is disabled in current environment. "
 
 Review comment:
   We should improve the exception message. It's not helpful from my point of view. What changed as following:
   `
   It's launching the PythonGatewayServer during Python UDF execution which is unexpected. It usually occurs in the cases that the job codes are in the top level of the Python script file and are not enclosed in a `if __name__ == '__main__'` statement.
   `

----------------------------------------------------------------
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] [flink] dianfu commented on a change in pull request #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.

Posted by GitBox <gi...@apache.org>.
dianfu commented on a change in pull request #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719#discussion_r407837285
 
 

 ##########
 File path: flink-python/pyflink/java_gateway.py
 ##########
 @@ -59,7 +67,10 @@ def launch_gateway():
     """
     launch jvm gateway
     """
-
+    if is_launch_java_gateway_disabled():
+        raise Exception("Launching java gateway is disabled in current environment. "
 
 Review comment:
   We should improve the exception message. It's not helpful from my point of view. What changed as following:
   `
   It's launching the PythonGatewayServer during Python UDF execution which is unexpected. It usually happens when the job codes are located in the top level of the Python script file and are not enclosed in a `if __name__ == '__main__'` statement.
   `

----------------------------------------------------------------
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] [flink] dianfu commented on a change in pull request #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.

Posted by GitBox <gi...@apache.org>.
dianfu commented on a change in pull request #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719#discussion_r407837733
 
 

 ##########
 File path: flink-python/src/main/java/org/apache/flink/python/env/ProcessPythonEnvironmentManager.java
 ##########
 @@ -190,6 +192,13 @@ public String createRetrievalToken() throws IOException {
 		// set BOOT_LOG_DIR.
 		env.put("BOOT_LOG_DIR", baseDirectory);
 
+		// disable the launching of gateway server to prevent from this dead loop:
+		// launch UDF worker -> import udf -> import job code
+		//        ^                                    | (If the job code is executed unexpectedly)
 
 Review comment:
   Should also update the comments `(If the job code is executed unexpectedly)`

----------------------------------------------------------------
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] [flink] dianfu closed pull request #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.

Posted by GitBox <gi...@apache.org>.
dianfu closed pull request #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719
 
 
   

----------------------------------------------------------------
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] [flink] flinkbot commented on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #11719: [FLINK-17124][python] Fix The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719#issuecomment-612955433
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * da8d3dcf0cbb8d4e112f50e3001ae48ee1705f50 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


With regards,
Apache Git Services