System Design Patterns: From Fundamentals to Real Systems
0% completed
Timeout
1. The Pattern
A timeout assigns a deadline to every network call. If no response arrives before that deadline, the caller declares failure and releases the resources reserved for the request.
Choose the maximum wait before making a call because many network clients otherwise use no practical deadline.
Python's requests library has no timeout unless the caller supplies one. A raw TCP connection to a machine that stops responding may remain open for several minutes before the operating system closes it.
The diagram below shows how the deadline changes request behavior.
Why is wait
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%