- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
It Doesn't Log. It Doesn't Alert. | Race Condition
On August 1, 2012, a trading firm in New Jersey watched four hundred and forty million dollars vanish in forty-five minutes. The deploy was clean. The servers were green. Every API call returned 200 OK. Every database write succeeded. Every log line was healthy. Nothing crashed.
The firm didn't survive the week.
This is one of the most expensive race conditions in the history of software. And the bug that did it is the same bug sitting in code you probably wrote this week.
The pattern has a name. TOCTOU — Time Of Check, to Time Of Use. You check the state. You decide what to do. You write the change. Three lines of code, all correct. But the world is allowed to change in between — and unless you've explicitly added a lock or a transaction, nothing watches the gap.
This is the bug that default monitoring can't see, generic alerts can't catch, and your application logs won't surface. Because every line ran successfully. Every write succeeded. There is no error to throw. The system did exactly what you told it to do. You just didn't tell it the right thing.
The deeper lesson is a frame shift. The bug wasn't in the code. The bug was in the assumption that the world stood still while the code was thinking. Junior engineers ask "how do I prevent this bug?" That's the wrong question. The right question is: who closes the gap?
This episode walks the failure step by step — two users withdrawing seventy rupees from a hundred-rupee account; both checks pass, both writes succeed, the balance goes negative — then scales the same shape up to Knight Capital, eight servers, one missing deploy, and a counter that climbed forty-five seconds at a time to four hundred and forty million dollars.
This is a runtime-shape concept, not a language trick. The same trap exists in JavaScript, Node.js, Python (asyncio), Java (CompletableFuture), Go (goroutines), Rust (async), Kotlin (coroutines) — and every database, queue, and distributed system you've ever used. If your code reads state, decides something, and then writes back without holding a lock or running inside a transaction — you have a TOCTOU bug. The question is only whether anyone has tripped it yet.
Topics: race condition, TOCTOU, time of check to time of use, check-then-act, knight capital, async race condition, concurrent state access, shared mutable state, lost update problem, compare-and-swap, optimistic locking, pessimistic locking, atomic operations, database isolation levels, distributed systems, async/await pitfalls, silent failure, monitoring blind spot, backend reliability, sre, postmortem culture, software engineering systems thinking
0:00 - $440 million. Nothing crashed.
0:13 - 45 minutes. All systems green.
0:28 - The bug is in code you wrote this week
0:41 - Two users. One account. ₹100.
1:07 - Thirty rupees that never existed
1:23 - TOCTOU — the gap has a name
1:39 - Why nothing caught it
1:55 - Knight Capital — August 1, 2012
2:19 - The quiet part — monitoring, alerts, logs
2:36 - The frame shift
2:48 - Wrong question, right question
2:58 - Vanish. Crash. Silent.
3:11 - Next Tuesday — catch it lying
📌 Key idea:
Stop asking "how do I prevent this bug?"
Start asking "who closes the gap?"
This is Episode 11 of The Leap — the closing chapter of a three-part arc on how async lies to you. Episodes 09, 10, and 11 belong together. Watch them in order if you haven't.
Previous: You Didn't Fix The Bug. You Muted It. — the unhandledRejection trap https://youtu.be/Ya3GzQhRjIc
Next: Catch It Lying — how to actually detect race conditions before production does
──────────────
The Leap is a series for software engineers who want to understand systems deeply — not just use them. No hype. No shortcuts. Just clarity.
If this changed how you think about state — subscribe.
#racecondition #toctou #asyncawait #knightcapital #systemsengineering
Видео It Doesn't Log. It Doesn't Alert. | Race Condition канала The Leap
The firm didn't survive the week.
This is one of the most expensive race conditions in the history of software. And the bug that did it is the same bug sitting in code you probably wrote this week.
The pattern has a name. TOCTOU — Time Of Check, to Time Of Use. You check the state. You decide what to do. You write the change. Three lines of code, all correct. But the world is allowed to change in between — and unless you've explicitly added a lock or a transaction, nothing watches the gap.
This is the bug that default monitoring can't see, generic alerts can't catch, and your application logs won't surface. Because every line ran successfully. Every write succeeded. There is no error to throw. The system did exactly what you told it to do. You just didn't tell it the right thing.
The deeper lesson is a frame shift. The bug wasn't in the code. The bug was in the assumption that the world stood still while the code was thinking. Junior engineers ask "how do I prevent this bug?" That's the wrong question. The right question is: who closes the gap?
This episode walks the failure step by step — two users withdrawing seventy rupees from a hundred-rupee account; both checks pass, both writes succeed, the balance goes negative — then scales the same shape up to Knight Capital, eight servers, one missing deploy, and a counter that climbed forty-five seconds at a time to four hundred and forty million dollars.
This is a runtime-shape concept, not a language trick. The same trap exists in JavaScript, Node.js, Python (asyncio), Java (CompletableFuture), Go (goroutines), Rust (async), Kotlin (coroutines) — and every database, queue, and distributed system you've ever used. If your code reads state, decides something, and then writes back without holding a lock or running inside a transaction — you have a TOCTOU bug. The question is only whether anyone has tripped it yet.
Topics: race condition, TOCTOU, time of check to time of use, check-then-act, knight capital, async race condition, concurrent state access, shared mutable state, lost update problem, compare-and-swap, optimistic locking, pessimistic locking, atomic operations, database isolation levels, distributed systems, async/await pitfalls, silent failure, monitoring blind spot, backend reliability, sre, postmortem culture, software engineering systems thinking
0:00 - $440 million. Nothing crashed.
0:13 - 45 minutes. All systems green.
0:28 - The bug is in code you wrote this week
0:41 - Two users. One account. ₹100.
1:07 - Thirty rupees that never existed
1:23 - TOCTOU — the gap has a name
1:39 - Why nothing caught it
1:55 - Knight Capital — August 1, 2012
2:19 - The quiet part — monitoring, alerts, logs
2:36 - The frame shift
2:48 - Wrong question, right question
2:58 - Vanish. Crash. Silent.
3:11 - Next Tuesday — catch it lying
📌 Key idea:
Stop asking "how do I prevent this bug?"
Start asking "who closes the gap?"
This is Episode 11 of The Leap — the closing chapter of a three-part arc on how async lies to you. Episodes 09, 10, and 11 belong together. Watch them in order if you haven't.
Previous: You Didn't Fix The Bug. You Muted It. — the unhandledRejection trap https://youtu.be/Ya3GzQhRjIc
Next: Catch It Lying — how to actually detect race conditions before production does
──────────────
The Leap is a series for software engineers who want to understand systems deeply — not just use them. No hype. No shortcuts. Just clarity.
If this changed how you think about state — subscribe.
#racecondition #toctou #asyncawait #knightcapital #systemsengineering
Видео It Doesn't Log. It Doesn't Alert. | Race Condition канала The Leap
race condition race condition explained toctou time of check to time of use knight capital knight capital bug race condition javascript race condition python race condition java async race condition check then act shared mutable state lost update problem compare and swap optimistic locking pessimistic locking atomic operations database isolation silent failure async await pitfalls the leap systems engineering sre distributed systems
Комментарии отсутствуют
Информация о видео
12 мая 2026 г. 23:22:02
00:03:17
Другие видео канала












