Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Our Hysteria2 connections died after every upload speed test. The fix was 37 lines.

Описание и применение

После теста скорости загрузки соединения Hysteria2 переставали отправлять данные, хотя оставались живыми. Добавление тайм‑аута на запись в целевой TCP‑коннектор и немедленное закрытие при отказе клиента исправило проблему.

Задача

Hysteria2 QUIC connections stopped sending stream data after an upload speed test, causing the transport to be declared dead while the connection appeared healthy.

Результат

Adding a per‑write stall timeout and immediate target closure resolved the issue, allowing Hysteria2 to recover from stalled uploads without manual intervention.

Рабочий процесс

  • 1. Capture traffic during a speed test to observe stalled state.
  • 2. Reproduce the issue on a loopback server with a Python harness that aborts uploads and checks new requests.
  • 3. Identify that the stall occurs when the target stops reading but keeps the connection open, filling the connection-level flow‑control window.
  • 4. Add a stall guard that times out writes that make no progress for 10 s.
  • 5. Close the target immediately when the client gives up the stream.
  • 6. Verify that new uploads succeed after the patch.

Доказательства

The client uploads through a Hysteria2 stream. The server dials the target over TCP and copies the stream into it.

Источник

Every write into a TCP target gets a fresh 10‑second budget. If one write makes no progress for 10 s, the target is closed.

Источник

  • Дата записи: 2026-10-16T00:41:21.655Z