[ https://issues.apache.org/jira/browse/BEAM-10158?focusedWorklogId=439627&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-439627 ]
ASF GitHub Bot logged work on BEAM-10158: ----------------------------------------- Author: ASF GitHub Bot Created on: 01/Jun/20 17:33 Start Date: 01/Jun/20 17:33 Worklog Time Spent: 10m Work Description: pabloem commented on a change in pull request #11867: URL: https://github.com/apache/beam/pull/11867#discussion_r433382446 ########## File path: sdks/python/apache_beam/utils/thread_pool_executor.py ########## @@ -134,3 +134,12 @@ def shutdown(self, wait=True): if wait: for worker in self._workers: worker.join() + + +class _SharedUnboundedThreadPoolExecutor(UnboundedThreadPoolExecutor): + def shutdown(self, wait=True): + # Prevent shutting down the shared thread pool + pass + + +SharedUnboundedThreadPoolExecutor = _SharedUnboundedThreadPoolExecutor() Review comment: Maybe give it a constant name? `SHARED_THREAD_POOL_EXECUTOR` or something like that? To clarify it's an instance, and not a class. I know we did not do this for `MetricsEnvironment`, but I think it may be better. ---------------------------------------------------------------- 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: 439627) Time Spent: 50m (was: 40m) > [Python] Reuse a shared unbounded thread pool > --------------------------------------------- > > Key: BEAM-10158 > URL: https://issues.apache.org/jira/browse/BEAM-10158 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core > Reporter: Luke Cwik > Assignee: Luke Cwik > Priority: P2 > Time Spent: 50m > Remaining Estimate: 0h > > During testing we create a lot of thread pools many of which we don't > shutdown which can lead to thread exhaustion on some machiens. > > Swapping to use a shared thread pool will decrease the memory overhead for > these unused threads and allow for greater reuse. -- This message was sent by Atlassian Jira (v8.3.4#803005)