timeout
A limit on how long a caller waits for an answer before giving up.
In more detail
A timeout means the outcome is unknown, not that nothing happened: the server may have finished the work. Every dependency call needs one, or a slow service can tie up all your capacity. gRPC calls this a deadline.
Examples
In AWS: The longest time something is allowed to run or wait before it is stopped and treated as failed.future.get(timeout=10)client := &http.Client{Timeout: 5 * time.Second}Go: context.WithTimeout(ctx, 2*time.Second) or http.Client{Timeout: 5 * time.Second}Java: future.get(2, TimeUnit.SECONDS); the course configuration record has a timeoutSeconds field.result.get(2, TimeUnit.SECONDS)In the worked outage a payment dependency starts timing out and checkout fails.In this course: Every network call needs one, and the timeout path is an error path that tests should reach with a double that raises. Reviewers should ask what the caller sees when a timeout happens.Related terms
- retry — Sending a request again after it failed or timed out, in the hope that it succeeds the second time.
- idempotency key — A unique value a client sends with a non-idempotent request, such as a create, so the server can recognise a retry and return the original result instead of acting twice.
- dependency — Anything a program needs in order to work, such as a library, a tool or another service.
- invocation — One run of a Lambda function in response to one event or request.
- idempotency — The property of an operation that gives the same result whether you run it once or many times, because a repeat run finds nothing left to do.
- session.timeout.ms — The consumer setting for how long the group coordinator waits without a heartbeat before declaring the consumer dead and rebalancing.
- KafkaTimeoutError — The kafka-python exception raised when an operation, such as waiting for a send to be acknowledged, takes longer than its time limit.
- resilience — An application's ability to keep working, or fail gracefully, when a dependency is slow or failing.
- CancellationToken — A .NET value passed into async methods that lets the caller signal that the work is no longer wanted and should stop.
- context deadline — A time limit attached to a context, after which it is cancelled automatically and ctx.Err() reports context.DeadlineExceeded.
- http.Client — The Go type that sends HTTP requests and returns responses, managing connections and timeouts for you.
- http.Server — The Go type that listens on a network address and serves HTTP requests through a handler, with fields for limits such as timeouts.
- blocking call — A call that makes the current thread wait, doing nothing else, until some result or event arrives.
- backpressure — A slow consumer signalling a fast producer to pause, so data does not pile up in memory faster than it can be handled.
- scrape timeout — How long Prometheus waits for a metrics page before giving up on that scrape.
- exporter — A component that sends telemetry out to a backend; in the collector it is the last stage of a pipeline.
- deadline — The point in time by which a request must finish, after which its answer is no longer useful.
- cascading failure — A failure in one part of a system that overloads or breaks the parts around it, spreading until much more is down.
- error path — The route through code taken when something goes wrong, such as invalid input, a timeout or a failed dependency.
- test double — Any object that replaces a real dependency in a test: a stub returns canned data, a fake is a small working implementation, and a mock checks interactions.
Taught in
- Streaming Responses — AI Engineering: LLM Apps, RAG & Agents
- When The Call Fails — AI Engineering: LLM Apps, RAG & Agents
- Connect An Agent To MCP — AI Engineering: LLM Apps, RAG & Agents
- Actions That Do Not Fit CRUD — Modern API Architecture: REST, GraphQL & gRPC
- Error Handling And Safe Retries — Modern API Architecture: REST, GraphQL & gRPC
- Mocking Dependencies — Modern API Architecture: REST, GraphQL & gRPC
- API Gateways And Proxies — Modern API Architecture: REST, GraphQL & gRPC
- Security Best Practices — Modern API Architecture: REST, GraphQL & gRPC
- The Night Larder Could Not Buy Servers Fast Enough — AWS Certified Cloud Practitioner (CLF-C02) Exam Prep
- Seven Ways To Leave A Rack — AWS Certified Cloud Practitioner (CLF-C02) Exam Prep
- Forty Eight Of Sixty Five — AWS Certified Cloud Practitioner (CLF-C02) Exam Prep
- The Network As A Control: CIDR, Routes, ACLs And Security Groups — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Decoupling: SQS, SNS, EventBridge And Step Functions — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Serverless And Container Patterns: Where The Limits Bite — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Compute Performance: Families, Placement And Lambda Memory — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Network Performance: Peering, Transit Gateway And The Edge — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- The Full Mock And Your Review Plan — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Route Tables and Internet Gateways — Cloud Infrastructure & Hyperscaler Architecture
- Security Groups and Firewalls — Cloud Infrastructure & Hyperscaler Architecture
- Load Balancing and DNS — Cloud Infrastructure & Hyperscaler Architecture
- Serverless Compute (Lambda) — Cloud Infrastructure & Hyperscaler Architecture
- The Retry That Overtook — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Two Copies Of One Service — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Too Slow Between Two Polls — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Twenty Seconds Of Nothing — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- The Alert That Came An Hour Late — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- A Sink That Died On Record Nine — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Two Brokers Down — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Forty One Under-Replicated Partitions — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Eleven Thousand Scans That Never Arrived — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- The Data Centre That Went Dark — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Built-in Rate Limiting Middleware — Modern .NET Core, C# & Enterprise Microservices
- Retry and Circuit Breaker Policies with Polly — Modern .NET Core, C# & Enterprise Microservices
- Variables, Typing, and Zero Values — Concurrent Systems Programming with Go
- Type Assertions and the Empty Interface — Concurrent Systems Programming with Go
- The select Statement — Concurrent Systems Programming with Go
- Context Cancellation and Timeouts — Concurrent Systems Programming with Go
- Calling APIs with net/http Client — Concurrent Systems Programming with Go
- Serving HTTP with net/http Server — Concurrent Systems Programming with Go
- Graceful Shutdown on SIGTERM — Concurrent Systems Programming with Go
- Handling Timeouts and Errors — Concurrent Systems Programming with Go
- The ExecutorService — Modern Java: Virtual Threads & High-Throughput Services
- Configuration And Profiles — Modern Java: Virtual Threads & High-Throughput Services
- A Producer In Python — Apache Kafka & Event Streaming
- Idempotent Producers And Retries — Apache Kafka & Event Streaming
- Rebalancing And Its Cost — Apache Kafka & Event Streaming
- Losing A Broker — Apache Kafka & Event Streaming
- Log Levels Done Properly — Full-Stack Observability: Metrics, Tracing & Logging
- Prometheus Scraping And The Pull Model — Full-Stack Observability: Metrics, Tracing & Logging
- The OpenTelemetry Collector — Full-Stack Observability: Metrics, Tracing & Logging
- Instrumenting A Service With Client Libraries — Full-Stack Observability: Metrics, Tracing & Logging
- A Worked Example Postmortem — Full-Stack Observability: Metrics, Tracing & Logging
- A Week Without A Scrape: Configuration And Relabelling — Prometheus Certified Associate (PCA) Exam Prep
- Seventy Seven Percent, Book Now? The Full Mock — Prometheus Certified Associate (PCA) Exam Prep
- Replication, Failover And Leader Election — Scalable System Design & Distributed Architecture
- Partitioning, Sharding And Hot Keys — Scalable System Design & Distributed Architecture
- Caching Strategies And Topology — Scalable System Design & Distributed Architecture
- Queues, Events And Asynchronous Work — Scalable System Design & Distributed Architecture
- The Difference Between A Queue And A Log — Scalable System Design & Distributed Architecture
- Idempotency, And Exactly Once As A Fiction — Scalable System Design & Distributed Architecture
- Load Balancing And The Failure Modes It Introduces — Scalable System Design & Distributed Architecture
- Timeouts, And Avoiding Cascaded Failure — Scalable System Design & Distributed Architecture
- Retries, Backoff And Jitter — Scalable System Design & Distributed Architecture
- Backpressure And Load Shedding — Scalable System Design & Distributed Architecture
- Monolith Versus Services: The Honest Trade Offs — Scalable System Design & Distributed Architecture
- Observability As A Design Input — Scalable System Design & Distributed Architecture
- Capacity Planning As A Design Input — Scalable System Design & Distributed Architecture
- Worked Design One: Scaling The Ticket Booking System — Scalable System Design & Distributed Architecture
- Worked Design Two: A Global Chat System — Scalable System Design & Distributed Architecture
- Worked Design Three: A Metrics Ingestion Pipeline — Scalable System Design & Distributed Architecture
- What Test Doubles Are For — Automated Testing, TDD & Quality Engineering
- Integration Testing With Containers — Automated Testing, TDD & Quality Engineering
- What To Look For In A Review — Automated Testing, TDD & Quality Engineering
- Writing Actionable Review Comments — Automated Testing, TDD & Quality Engineering
References
- Amazon Builders’ Library: Timeouts, retries and backoff with jitter
- gRPC: Core concepts
- Configure Lambda function timeout
- kafka-python KafkaProducer
- Timeout strategy (Polly)
- Build resilient HTTP apps
- Package context: WithTimeout
- Package net/http: Client
- Java SE 21 API: Future
- Collector batch processor
- gRPC documentation: Deadlines
- Google SRE book: addressing cascading failures
- Python docs: socket timeouts
Certification courses
- AWS AIP-C01 course and practice exam: AI engineering with LLM apps, RAG and agents
- AWS Cloud Practitioner course and practice exam: CLF-C02
- AWS Solutions Architect Associate course and practice exam: SAA-C03
- CCDAK and CCAAK course and practice exams: Confluent Apache Kafka certifications
- PCA course and practice exam: Prometheus Certified Associate