Chapter 2: The network

One more word, for when the journey doesn't finish at all.

Timeout

A limit on how long to wait for something before giving up and reporting failure. Without one, a program waiting on a server that never replies can wait for ever, holding on to everything it was using.

Agents rarely add timeouts unless asked, because the code works without them, right up to the day a service you depend on goes slow. Then requests pile up waiting, and pages that never touch that service go down too. Asking is one sentence.

Say it to your agent

“Every outbound call gets a timeout: fetch(url, { signal: AbortSignal.timeout(3000) }). On a timeout, return 504 and log which upstream it was. Add a test with a fake upstream that never replies, and check that the route answers within about 3 seconds.”

The workshop

Name a word, or describe what you mean in everyday language.