⚖ Compare news

Put up to three stories side by side. Pick IDs from any article URL: /compare?id=123&id=456

[Перевод] Два git notes add параллельно: оба вернули 0, а одна заметка пропала

habrahabr.ru ·Russian Federation · world
Words
80
Chars
532
AI summary
Yes
Full story

Two git notes add commands ran at the same time, each adding a note to a different commit. Both commands returned exit code 0, but one note disappeared. On an ordinary Linux machine this happened in 25 of 30 runs. Farid Zakaria found the race with his deterministic virtual machine Rewind VM. He shows how three questions to recorded runs lead from “the test sometimes fails” to a single line in notes-utils.c that carries out an update.

Две команды git notes add добавляют заметки к двум разным коммитам одновременно. Обе завершаются с кодом 0, но одна заметка исчезает: на обычной Linux-машине — в 25 запусках из 30. Фарид Закария нашёл эту гонку своей детерминированной виртуальной машиной Rewind VM и показывает, как тремя вопросами к записанным прогонам дойти от «тест иногда падает» до одной строки в notes-utils.c, которая обновляет ссылку refs/notes/commits без проверки, что её не успел изменить соседний процесс. Патч уже отправлен в рассылку git. Читать далее

Open article