python
9 minAsync Python Cancellation and Timeouts: Stop Work Without Leaking It
Understand task cancellation, timeout scopes, cleanup, and the failure modes that leave background work running.
Loading page...
python
9 minUnderstand task cancellation, timeout scopes, cleanup, and the failure modes that leave background work running.
Q&A
Q&AFresh timeouts at each stage multiply the total wait.
Measure elapsed time locally with nanoTime and give each stage only the shared budget remaining. Expiry stops admission of more work; it does not prove a remote write was cancelled.
python
8 minA practical guide to request concurrency, connection pools, timeouts, and overload behavior in async Python APIs.
Q&A
Q&ABound concurrency and queue depth at the scarce resource, and enforce an end-to-end deadline.
Use bounded connection pools, semaphores or worker queues, request deadlines, and deliberate overload responses. Local limits must account for replica count because each replica has its own pool. Avoid unbounded in-memory tasks and retries that amplify load during an incident.
Q&A
Q&ACompletion stages form a dependency graph; blocking the wrong executor can starve that graph.
CompletableFuture represents a value that may complete later, with dependent stages triggered on completion. Async methods without an explicit executor commonly use a shared pool; blocking calls there can starve unrelated work. Prefer non-blocking composition, choose an executor suited to the task, set timeouts, and observe exceptional completion rather than calling join() throughout request paths.
distributed systems
9 minSeparate consistency guarantees from delivery guarantees and design for the partial failures that make retries necessary.
distributed systems
12 minConsumer groups are the mechanism that turns Kafka partitions into scalable, failure-tolerant work units. Learn how rebalances, offsets, and lag interact under load before you ship your first serious pipeline.
java
6 minSeparate elapsed time from civil time and carry a shrinking deadline through a request.