Interactive engineering lab

gRPC pick_first attempts: per-address subchannels and Happy Eyeballs

gRPC pick_first attempts: per-address subchannels and Happy Eyeballs. Replay a first connection pass of grpc-java 1.86 on a timeline.

By Sandeep Belgavi · Published 2026-11-26

Synthetic fixtures computed locally. No model or production service is contacted.

Experiment workspace

Decision trace

    The question this experiment answers

    How long does a gRPC Java client using pick_first take to reach READY, and which address does it choose, when some resolved addresses are slow, refused or silently dropped? The lab replays the first connection pass as written in the grpc-java v1.86.0 sources: duplicate addresses removed, one subchannel per address, attempts one at a time in list order by default, and with Happy Eyeballs enabled an interleaved order by address family and a new attempt every 250 ms while earlier ones continue. No sockets, resolver or gRPC library are involved.

    Change one assumption at a time

    Scenario preset loads an address list. Each line is an address, its family (v4 or v6), its outcome (ok, refused or timeout) and, for ok and refused, how many milliseconds the attempt takes. A timeout line takes the connect attempt timeout instead, which is an input of this lab and not a claim about any gRPC default. Mode switches between serial pick_first, the 1.86.0 default, and Happy Eyeballs, which grpc-java uses only when GRPC_PF_USE_HAPPY_EYEBALLS is true. Run experiment after editing; until then the previous result stays on screen and export is disabled.

    Expected outcomes

    With the IPv6 blackholed preset, serial mode and a 20000 ms timeout, the client is READY at 40030 ms on 192.0.2.10:443 after three attempts, one at a time. Happy Eyeballs reaches READY at 280 ms on the same address with two attempts in flight. Lowering the timeout to 5000 ms makes the serial result 10030 ms. The refused preset removes one duplicate address and is READY at 42 ms in both modes, because a refused attempt moves to the next address immediately. With every address down, both modes report TRANSIENT_FAILURE at 20003 ms and request name re-resolution once. With a slow IPv6 first address, serial mode waits 900 ms for it while Happy Eyeballs picks IPv4 at 270 ms.

    Read the table and the trace

    Each table row is one connection attempt: the address, its family, start and end times in milliseconds, the outcome, whether it was chosen and why it started (the first address, the previous attempt failing, or the 250 ms timer). In Happy Eyeballs mode an attempt still running when another one wins is shown as shut down. The decision trace starts with the inputs, then explains each step. Start trace clears the visible steps, Next step reveals one more, Show all reveals every step and the slider selects any prefix.

    Reset and export

    Reset inputs restores the first preset, serial mode and the 20000 ms timeout, then recomputes. Export JSON downloads the inputs, every attempt row, the metrics, the trace, the model version and the limitations, so the timeline can be compared with logs from a real client. Nothing is stored in the browser or sent anywhere.

    Limits

    Only the first pass is modelled. After it, grpc-java subchannels back off per address and the balancer reconnects whenever one becomes idle; health checking, resolver updates during a pass and real network behaviour are not simulated. The 250 ms delay is the constant in grpc-java v1.86.0; other gRPC languages and versions may differ. Treat the numbers as a teaching timeline and verify with your own client. Views are my own and do not represent any employer, past or present.