github sleep3r/mtproto.zig v0.8.1

latest releases: v1.15.1, v1.15.0, v1.14.1...
5 months ago

0.8.1 (2026-04-07)

🇷🇺 Release notes (RU)

Проблемы, которые решает этот релиз

  • В редком, но критичном сценарии прокси мог не закрывать слот, если клиент разрывал соединение во время connecting_upstream.
  • В этом случае возможен epoll busy-loop и всплеск утилизации CPU под connect/disconnect churn.

Что исправлено и улучшено

  • Точечная обработка fatal hangup: во время connecting_upstream исключение применяется только к upstream_fd (ожидаемый connect error path), а client_fd теперь корректно закрывает слот.
  • Закрыт источник CPU spin: client-side EPOLLRDHUP/HUP/ERR больше не оставляет зависшие слоты в цикле событий.
  • Добавлен регрессионный тест: проверяет различие политики закрытия для client_fd и upstream_fd в connecting_upstream; без фикса тест падает.
  • Обновлена Android evidence-база в .agent: ссылки в client-behavior обновлены на актуальный snapshot Telegram Android (master, commit 009e973...).

Важно

  • Релиз рекомендуется всем, кто наблюдал периодические CPU spikes при высоком churn подключений.
  • Изменение обратно-совместимо по конфигу и не требует тюнинга параметров.

Благодарности

  • Отдельное спасибо @va4st — помог закрыть этот баг в реальном продовом сценарии.

🇬🇧 Release notes (EN)

Problems addressed in this release

  • In a rare but critical scenario, the proxy could keep a slot open when the client disconnected during connecting_upstream.
  • This could cause an epoll busy-loop and CPU spikes under heavy connect/disconnect churn.

What is fixed and improved

  • Precise fatal hangup handling: during connecting_upstream, the exception is now scoped to upstream_fd only (expected connect error path), while client_fd hangups close the slot immediately.
  • CPU spin source removed: client-side EPOLLRDHUP/HUP/ERR no longer leaves stale slots in the event loop.
  • Regression test added: verifies close-policy distinction between client_fd and upstream_fd in connecting_upstream; it fails without this fix.
  • Android evidence docs refreshed in .agent: client-behavior links were updated to the current Telegram Android snapshot (master, commit 009e973...).

Important

  • This release is recommended for operators seeing periodic CPU spikes under high connection churn.
  • The change is config-compatible and requires no parameter retuning.

Acknowledgements

  • Special thanks to @va4st for helping close this bug in a real production scenario.

Bug Fixes

  • proxy: close slots on client hangup during upstream connect (#84) (353a9c4)
  • docs(agent): refresh Android client behavior sources to current Telegram Android snapshot (009e973...) (353a9c4)

This PR is managed by Release Please.

Don't miss a new mtproto.zig release

NewReleases is sending notifications on new releases.