TOCTOU Bugs and Exactly-Once Delivery

Formal methods with Hillel Wayne

Topic 8 of 17

Published Jul 29, 2026 · Clip 38:08–41:03 (2:55)

Hillel identifies time-to-check-time-to-use (TOCTOU) bugs as the classic recurring distributed-systems failure beyond race conditions and locks, illustrated with a bank withdrawal example where funds are checked and then removed by another actor before the deduction. The host connects this to Uber's payment system and the difficulty of exactly-once message delivery versus at-least-once, and they discuss why businesses over-authorize and refund (hotels putting a hold on credit cards) as an engineering and risk decision.