← TCP/IP: fundamentals and diagnosis
10 / 12 · 60 MIN

Deadlines, late responses and handover

Distinguish per-call timeout from overall deadline, correlate late responses and define RUN acceptance criteria.

Predict a slow stream’s effect

In the per-read-timeout group, the server produces ten bytes roughly 0.08 seconds apart and the client uses recv(1) with a 0.4-second timeout. Each call can finish within its limit while the entire loop takes longer than 0.4 seconds. Before execution, draw a timeline for the ten reads. Then compare the prediction with evidence.json. Do not confuse this manual loop with the sendall contract, which has its own documented timeout rules. Experiment values are teaching parameters, not SLA recommendations.

Carry a remaining budget

The receive_exact helper accepts an absolute deadline calculated with time.monotonic. Before each read it subtracts the current instant and uses the remainder as the timeout. If the budget has expired, it does not start recv. The next group records exactly zero calls for a past deadline. For an operation with queueing, connection setup and reading, the budget should follow the phases included by the contract. The lab executes only reading; it does not demonstrate a complete distributed deadline. A 0.8-second wait and 0.5-second connection leave at most 0.7 from an original two-second budget.

Interpret expiry without inventing cancellation

With a 0.25-second budget, the helper observes only some of the ten bytes and raises DeadlineExpired. Partial bytes remain available for diagnosis and are not delivered as a complete response. Afterwards the fixture sets a local Event to stop the producer thread and collect resources. That Event is in-process cleanup, not a remote cancellation protocol. Measured time can slightly exceed the budget through scheduling and cleanup. Record duration and scope; do not promise execution at exactly 0.250000 seconds or reversal of business effects.

Give responses an identity

The last group sends R1, observes timeout, sends R2 and only then receives R1|OK. The teaching parser bounds the line to 64 bytes and extracts the ID before assigning the result. R1 is not promoted to R2 success; the following response identifies R2. In a real service, R1 reconciliation depends on the business contract and request retention. If the protocol does not identify responses or provide resynchronization, reusing the connection after timeout may be unsafe. Draining currently available bytes does not exclude an even later response.

Prepare an English shift handover

Use the worksheet below for a proposed shift-handover simulation. Fill in observation, impact, hypothesis, action, owner and next update. Separate what ran on loopback from what still requires a representative exercise. No human workshop was performed during this review. Use monotonic differences for local durations; also retain timestamps and clock context to correlate logs across teams. Never compare monotonic values from different machines as if they shared a universal date. The experiment did not change the system clock or validate synchronization between servers.

Define operational acceptance

Propose acceptance criteria for three situations: a slow consumer, deadline expiry with partial data and a response from an earlier request. For each, define the metric, agreed threshold, permitted action and resumption evidence. RUN should be able to explain the fate of accepted work and recognize when a session cannot return to the pool. The ten local groups support understanding of the mechanisms but do not demonstrate representative load, persistence, TLS or the production path. Approval requires service-appropriate evidence and owners for identified gaps, without turning a test count into a global guarantee.

PROPOSED ENGLISH HANDOVER WORKSHEET
Observed: phase, connection tuple, request ID, accepted/received bytes.
Time: UTC for correlation; monotonic elapsed duration for the local budget.
Impact: pending work, oldest queue item, affected business result.
Known: exact local observations and runtime version.
Unknown: remote effect, representative path, persistence and load behavior.
Action: admission limit / deadline handling / session removal / reconciliation.
Owner: named operational role; next update time; escalation criterion.
Recovery: queue drains, responses match IDs, accepted work is accounted for.
Acceptance: evidence, remaining exercise, owner and approval condition.
Lab statement: Loopback checks passed; target-path timing and business
persistence remain untested. No human workshop has been performed.
IN PRACTICE

Proposed simulation: R1 expired at 10:02:00, R2 was sent and R1|OK arrived. Write each request’s state, what remains unproven and the next reconciliation action in English.

Common pitfalls

Renewing the deadline at each layer, delivering prefixes as complete responses, confusing thread cleanup with remote cancellation and assigning an R1 response to R2.

Related topics: Transport, acknowledgement, and messages · States, queues, and flow control · Diagnosis in the application context

Take this idea with you

The deadline controls local waiting. Identity controls result attribution. Recovery requires explicit rules for partial data and late responses.

Create account

Reference: Python monotonic clock · BigSavant TCP/IP 2026-09; TCP RFC 9293; IPv6 RFC 8200 with RFC 9673 update; Linux socket and iproute2 guidance