Repository navigation
Open
Labels
enhancementNew feature or request
Description
Python 3.14 adds InterpreterPoolExecutor, a subclass of ThreadPoolExecutor that runs tasks in isolated subinterpreters.
The Temporal Python SDK appears to assume ThreadPoolExecutor-like behavior in worker/_activity.py, which doesn’t hold for InterpreterPoolExecutor. Using it as an activity executor leads to the following errors:
concurrent.interpreters.NotShareableError: (Queue(2), <built-in method run of _contextvars.Context object at 0x1015fec00>, (<function _execute_sync_activity at 0x1014171c0>, Info(activity_id='61', activity_type='task', attempt=3, current_attempt_scheduled_time=datetime.datetime(2025, 10, 13, 9, 32, 51, 324811, tzinfo=datetime.timezone.utc), heartbeat_details=[], heartbeat_timeout=None, is_local=False, schedule_to_close_timeout=None, scheduled_time=datetime.datetime(2025, 10, 13, 9, 32, 47, 122424, tzinfo=datetime.timezone.utc), start_to_close_timeout=datetime.timedelta(seconds=36000), started_time=datetime.datetime(2025, 10, 13, 9, 32, 51, 692224, tzinfo=datetime.timezone.utc), task_queue='hello-task-queue', task_token=b'\n$0199c8e3-3716-7223-b18b-3a720150440f\x1231906eac1-8e34-4119-b7d5-0da5e8ffefd4-hello-workflow\x1a$0199dcea-4e2f-7cb2-bf9b-ef9859498ab6 A(\x032\x0261B\x04taskJ\x08\x08\x01\x10\x93\xb4A\x18\x01', workflow_id='1906eac1-8e34-4119-b7d5-0da5e8ffefd4-hello-workflow', workflow_namespace='default', workflow_run_id='0199dcea-4e2f-7cb2-bf9b-ef9859498ab6', workflow_type='GreetingWorkflow', priority=Priority(priority_key=None, fairness_key=None, fairness_weight=None), retry_policy=RetryPolicy(initial_interval=datetime.timedelta(seconds=1), backoff_coefficient=2.0, maximum_interval=datetime.timedelta(seconds=100), maximum_attempts=0, non_retryable_error_types=None)), <function _ActivityInboundImpl.execute_activity.<locals>.<lambda> at 0x1016381a0>, <temporalio.worker._activity._ThreadExceptionRaiser object at 0x10161df60>, <threading.Event at 0x101620fb0: unset>, <threading.Event at 0x10152d810: unset>, <temporalio.converter.DefaultPayloadConverter object at 0x1010e4c20>, <temporalio.common._NoopMetricMeter object at 0x100d9be00>, _ActivityCancellationDetailsHolder(details=None), <function task at 0x101529430>), {}) does not support cross-interpreter dataReacted by Haoyu YANG 杨浩宇, SUDIPTA PRADHAN and J Derek Wilson
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
tconley1428 commentedon Oct 15, 2025
We'll take a look when we can. We still have to do some due diligence on compatibility with python 3.14 as a whole. Some of our dev dependencies don't (or didn't recently) support 3.14 yet, so officially supporting and validating it will take some work.
blueraft commentedon Oct 15, 2025
Thanks, appreciate it!
walid-amro commentedon Sep 6, 2026
Any updates on this?
tconley1428 commentedon Sep 10, 2026
It's not something we've been able to prioritize as yet, so we don't have an update unfortunately.
tconley1428 commentedon Oct 1, 2026
I did some quick initial investigation, it seems like this would be a very substantial project. We currently rely on the shareable nature of the different activity threads to do things like heartbeating and coordination, and our use of py03 doesn't currently support subinterpreters. We would need to change the way we interact with the activity "threads" or build some new abstraction. I don't think we have sufficient justification for that work at the moment, but we should be more clear about this limitation in the runtime.