fix(telegram): handle EADDRNOTAVAIL local socket exhaustion correctly [AI-assisted]#94971
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 21, 2026, 5:42 PM ET / 21:42 UTC. Summary PR surface: Source +6, Tests +21. Total +27 across 2 files. Reproducibility: yes. at source level: probeTelegram catches the original getMe error but calls forceFallback with only a reason, and forceFallback logs from a synthetic error. I did not run a live socket-exhaustion repro. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Land one complete Telegram transport fix that carries EADDRNOTAVAIL through both direct fetch classification and forced fallback promotion while preserving valid timeout and IPv4 recovery fallback. Do we have a high-confidence way to reproduce the issue? Yes, at source level: probeTelegram catches the original getMe error but calls forceFallback with only a reason, and forceFallback logs from a synthetic error. I did not run a live socket-exhaustion repro. Is this the best way to solve the issue? No. The direct classifier guard is useful but not the best complete fix because forced fallback promotion can still lose EADDRNOTAVAIL before the pinned-IP warning path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 108d6d7eca00. Label changesLabel justifications:
Evidence reviewedPR surface: Source +6, Tests +21. Total +27 across 2 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Superseded by #97130, landed as 072d3ed. The landed fix addresses the same Telegram Thank you, @aniruddhaadak80. |
Summary
This PR resolves an issue where the Telegram transport incorrectly attempts IP-rotation fallback retries when hitting a local socket allocation failure (
EADDRNOTAVAIL).Changes
shouldUseTelegramTransportFallbackinextensions/telegram/src/fetch.tsto detectEADDRNOTAVAILerror codes or socket allocation failure error messages.EADDRNOTAVAILis detected, it logs an accurate warning message ("telegram transport encountered local socket allocation failure (EADDRNOTAVAIL) — check ephemeral ports / mbuf zones / network extensions; remote IP rotation will not help") and returnsfalseto immediately throw the error, skipping unnecessary IP-rotation retries.extensions/telegram/src/fetch.test.tsto verify the correct handling ofEADDRNOTAVAILsocket allocation failures.Real behavior proof
All tests in
extensions/telegram/src/fetch.test.tspass successfully: