[ 
https://issues.apache.org/jira/browse/BEAM-6754?focusedWorklogId=208168&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-208168
 ]

ASF GitHub Bot logged work on BEAM-6754:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 05/Mar/19 23:44
            Start Date: 05/Mar/19 23:44
    Worklog Time Spent: 10m 
      Work Description: angoenka commented on pull request #7984: [BEAM-6754] 
Use subprocess instead of threads in loopback environment
URL: https://github.com/apache/beam/pull/7984#discussion_r262737611
 
 

 ##########
 File path: sdks/python/apache_beam/runners/portability/portable_runner.py
 ##########
 @@ -445,15 +446,22 @@ def start(cls, worker_threads=1):
 
   def NotifyRunnerAvailable(self, start_worker_request, context):
     try:
-      worker = sdk_worker.SdkHarness(
-          start_worker_request.control_endpoint.url,
-          worker_count=self._worker_threads,
-          worker_id=start_worker_request.worker_id)
-      worker_thread = threading.Thread(
-          name='run_worker_%s' % start_worker_request.worker_id,
-          target=worker.run)
-      worker_thread.daemon = True
-      worker_thread.start()
+      command = ['python', '-c',
+                 'from apache_beam.runners.worker.sdk_worker '
+                 'import SdkHarness as SH; '
+                 'SH("%s",worker_count=%d,worker_id="%s").run()' % (
+                     start_worker_request.control_endpoint.url,
+                     self._worker_threads,
+                     start_worker_request.worker_id), ]
+      logging.warn("Starting worker with command %s" % (command))
+      process = subprocess.Popen(command, stdout=subprocess.PIPE, )
+
+      def kill_subprocess():
+        process.kill()
 
 Review comment:
   There is no parameter for forceful kill. I suppose the kill method will 
ensure that the subprocress is killed.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 208168)
    Time Spent: 1h 50m  (was: 1h 40m)

> Support multi core machines for python pipeline on flink for loopback 
> environment
> ---------------------------------------------------------------------------------
>
>                 Key: BEAM-6754
>                 URL: https://issues.apache.org/jira/browse/BEAM-6754
>             Project: Beam
>          Issue Type: Task
>          Components: runner-core, runner-flink
>            Reporter: Ankur Goenka
>            Assignee: Ankur Goenka
>            Priority: Major
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> Loopbck worker is shared across multiple taskmanagers on a single machine. We 
> should supportĀ starting multiple processĀ in loopback worker based on number 
> of cores.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to