You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "iatkinson (via GitHub)" <gi...@apache.org> on 2025/09/29 13:32:58 UTC

[I] ExecutorFactory is not compatible with fork multiprocessing [iceberg-python]

iatkinson opened a new issue, #2545:
URL: https://github.com/apache/iceberg-python/issues/2545

   ### Apache Iceberg version
   
   0.10.0 (latest release)
   
   ### Please describe the bug 🐞
   
   When using pyiceberg in multiprocessing code the `ExecutorFactory` can get into an invalid state when forking a new process.  Simple example demonstrating:
   
   ```
   import multiprocessing
   from concurrent.futures import ProcessPoolExecutor
   
   from pyiceberg.utils.concurrent import ExecutorFactory
   
   
   def use_executor_to_return(value):
       executor = ExecutorFactory.get_or_create()
       future = executor.submit(lambda: value)
       return future.result()
   
   if __name__ == "__main__":
   
       multiprocessing.set_start_method("fork", force=True)
   
       main_value = use_executor_to_return(10)
   
       with ProcessPoolExecutor() as process_executor:
           # Hangs since fork + singleton executor does not work.
           future = process_executor.submit(use_executor_to_return, 20)
   
       # Never reached.
       assert main_value == 10
       assert future.result() == 20
   ```
   
   ### Willingness to contribute
   
   - [x] I can contribute a fix for this bug independently
   - [x] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
   - [ ] I cannot contribute a fix for this bug at this time


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] ExecutorFactory is not compatible with fork multiprocessing [iceberg-python]

Posted by "Fokko (via GitHub)" <gi...@apache.org>.
Fokko closed issue #2545: ExecutorFactory is not compatible with fork multiprocessing
URL: https://github.com/apache/iceberg-python/issues/2545


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org