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

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

                Author: ASF GitHub Bot
            Created on: 13/Nov/19 19:46
            Start Date: 13/Nov/19 19:46
    Worklog Time Spent: 10m 
      Work Description: acrites commented on pull request #10091: (WIP) 
[BEAM-8151] Swap to create SdkWorkers on demand when processing portable jobs
URL: https://github.com/apache/beam/pull/10091#discussion_r345964729
 
 

 ##########
 File path: sdks/python/apache_beam/runners/worker/sdk_worker.py
 ##########
 @@ -269,6 +250,24 @@ def _monitor_process_bundle(self):
               logging.warning('Unable to schedule instruction %s for %s',
                               instruction_id, scheduling_delay)
 
+  def _get_or_create_worker(self):
+    """Gets an idle worker or creates a new one if none are idle."""
+    try:
+      self.workers.get(wait=False)
+    except queue.Empty:
 
 Review comment:
   We're now creating a new worker any time we need work and the queue is 
empty. When we return the worker after processing, do we have a limit to the 
number allowed in the queue? If not, then the queue size will always grow to 
the high water mark of number needed.
 
----------------------------------------------------------------
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: 342837)
    Time Spent: 9h 50m  (was: 9h 40m)

> Allow the Python SDK to use many many threads
> ---------------------------------------------
>
>                 Key: BEAM-8151
>                 URL: https://issues.apache.org/jira/browse/BEAM-8151
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-core, sdk-py-harness
>            Reporter: Luke Cwik
>            Assignee: Luke Cwik
>            Priority: Major
>          Time Spent: 9h 50m
>  Remaining Estimate: 0h
>
> We need to use a thread pool which shrinks the number of active threads when 
> they are not being used.
>  
> This is to prevent any stuckness issues related to a runner scheduling more 
> work items then there are "work" threads inside the SDK harness.
>  
> By default the control plane should have all "requests" being processed in 
> parallel and the runner is responsible for not overloading the SDK with too 
> much work.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to