This is an automated email from the ASF dual-hosted git repository.

hxb pushed a commit to branch release-1.13
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.13 by this push:
     new 10df24b  [FLINK-23493][python] Remove the calling of child process in 
the beam_boot.py
10df24b is described below

commit 10df24bbd87d2a16e6ea7b7c124807a167793a37
Author: huangxingbo <[email protected]>
AuthorDate: Tue Dec 7 10:11:41 2021 +0800

    [FLINK-23493][python] Remove the calling of child process in the 
beam_boot.py
---
 flink-python/pyflink/fn_execution/beam/beam_boot.py            | 6 +++---
 flink-python/pyflink/fn_execution/beam/beam_sdk_worker_main.py | 6 +++++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/flink-python/pyflink/fn_execution/beam/beam_boot.py 
b/flink-python/pyflink/fn_execution/beam/beam_boot.py
index b0c42dc..547605b 100644
--- a/flink-python/pyflink/fn_execution/beam/beam_boot.py
+++ b/flink-python/pyflink/fn_execution/beam/beam_boot.py
@@ -29,7 +29,6 @@ harness of Apache Beam.
 """
 import argparse
 import os
-from subprocess import call
 
 import grpc
 import logging
@@ -97,5 +96,6 @@ if __name__ == "__main__":
     if "FLINK_BOOT_TESTING" in os.environ and os.environ["FLINK_BOOT_TESTING"] 
== "1":
         exit(0)
 
-    call([python_exec, "-m", "pyflink.fn_execution.beam.beam_sdk_worker_main"],
-         stdout=sys.stdout, stderr=sys.stderr, env=env)
+    from pyflink.fn_execution.beam import beam_sdk_worker_main
+
+    beam_sdk_worker_main.main()
diff --git a/flink-python/pyflink/fn_execution/beam/beam_sdk_worker_main.py 
b/flink-python/pyflink/fn_execution/beam/beam_sdk_worker_main.py
index f8c0957..15e12cd 100644
--- a/flink-python/pyflink/fn_execution/beam/beam_sdk_worker_main.py
+++ b/flink-python/pyflink/fn_execution/beam/beam_sdk_worker_main.py
@@ -29,5 +29,9 @@ import apache_beam.runners.worker.sdk_worker_main
 from apache_beam.runners.worker import sdk_worker
 sdk_worker.DEFAULT_BUNDLE_PROCESSOR_CACHE_SHUTDOWN_THRESHOLD_S = 86400 * 365 * 
100
 
-if __name__ == '__main__':
+
+def main():
+    import logging
+    # Remove all the built-in log handles
+    logging.getLogger().handlers = []
     apache_beam.runners.worker.sdk_worker_main.main(sys.argv)

Reply via email to