Networkinghol blockinghol

Head-of-line blocking

Definition

Head-of-line blocking happens when strict ordering forces later, independent items to wait for an earlier one that is delayed, lost or failing.

In practice

In TCP, one lost packet holds back every later byte until it is retransmitted, so all HTTP/2 streams sharing that connection stall together; QUIC fixes this by ordering each stream separately. HTTP/1.1 had its own version: one slow response blocked the next on the same connection. Message consumers suffer it too, when a poison message retried in place blocks its whole partition.

The cure is to order only what really needs ordering: separate streams, per-key partitions or retry topics. Each relaxation trades something. Moving failed messages to a retry topic keeps the partition flowing but lets later events overtake earlier ones, so consumers need versions or sequence numbers to reject stale updates.

Example

One message in partition 3 makes the handler throw; with in-place retries, the 40,000 messages behind it wait, and lag on that partition climbs while the other 11 partitions stay at zero.