Company
Date Published
Author
swyx
Word count
1761
Language
English
Hacker News points
None

Summary

Temporal, a workflow engine, implements retries and timeouts for Activities in a standardized way, adding a reliability layer atop unreliable Activities and Workers. The four types of Activity timeouts are Schedule-To-Close, Start-To-Close, Heartbeat, and Schedule-To-Start. The Schedule-To-Close timeout controls the overall maximum time allowed for an Activity Execution, including all retries. The Start-To-Close timeout limits the maximum amount of time a single Activity Execution can take, preventing "stuck" Activity Executions that would cause indefinite delays. The Heartbeat timeout fails the Activity Execution when the Temporal Server doesn't receive a heartbeat from the Activity Worker at the expected frequency, allowing for quicker retries. The Schedule-To-Start timeout sets a limit on the amount of time an Activity Task can sit in a Task Queue, useful for identifying and addressing issues with task routing or queue draining. These timeouts are used to control the lifecycle of an Activity as it journeys through the system, from Workflow Worker to Temporal Server and back. Understanding these timeouts is crucial for building reliable systems using Temporal.