mirror of
https://github.com/Flowseal/tg-ws-proxy.git
synced 2026-10-21 02:58:45 +00:00
fix socketpair EOF
This commit is contained in:
1 parent
a232472cbe
commit
a0a92f5e7e
6 files changed
+396
-4
No files matched your search
+7
-3
@@ -525,10 +525,14 @@ class _HttpChannel:
|
||||
|
||||
async def _recover(self) -> None:
|
||||
while not self.closed:
|
||||
wakeup = asyncio.create_task(self.recovery_wakeup.wait())
|
||||
try:
|
||||
await asyncio.wait_for(self.recovery_wakeup.wait(), REPLAY_CHECK_SECONDS)
|
||||
except asyncio.TimeoutError:
|
||||
pass
|
||||
# wait_for can swallow cancellation when the wakeup completes
|
||||
# at the same time on Python 3.8-3.11 (CPython #86296).
|
||||
await asyncio.wait((wakeup,), timeout=REPLAY_CHECK_SECONDS)
|
||||
finally:
|
||||
wakeup.cancel()
|
||||
await asyncio.gather(wakeup, return_exceptions=True)
|
||||
self.recovery_wakeup.clear()
|
||||
now = time.monotonic()
|
||||
self.lane.log_wait(now)
|
||||
|
||||
Reference in new issue
Block a user