-
Notifications
You must be signed in to change notification settings - Fork 137
Description
Is your feature request related to a problem? Please describe.
Currently, the Temporal Python SDK enforces a fixed 2-second deadlock detection timeout for workflows. This behavior cannot be configured in production: the only way to disable it is to run in debug_mode or set TEMPORAL_DEBUG.
This creates friction for production workflows that legitimately need longer CPU-bound or blocking sections. Unlike the Go SDK, which allows configuring WorkerOptions.DeadlockDetectionTimeout, the Python SDK forces developers to restructure code even in cases where a slightly longer threshold would be sufficient.
Describe the solution you'd like
Introduce a configurable deadlock detection timeout for the Python SDK, similar to Go’s DeadlockDetectionTimeout option.
Example proposal:
worker = Worker(
client,
task_queue="my-task-queue",
workflows=[MyWorkflow],
activities=[...],
deadlock_detection_timeout=timedelta(seconds=5) # new option
)
Default remains 2 seconds (to preserve current behavior).
Users can override the timeout per worker in production.
Setting None (or 0) could fully disable the check, mirroring debug mode.