fix(infra): prevent gateway exit on wrapped transient DNS/network errors#24582
Merged
steipete merged 1 commit intoFeb 23, 2026
Merged
Conversation
Contributor
Author
|
Self-review: second pass update. I kept detection strict for wrapped network errors only. Added a guard test where without network signal stays fatal (no false non-fatal downgrade). |
Contributor
Author
|
Self-review (fix): I added a guard test where slack_webapi_request_error without any network indicator is still treated as fatal. |
Contributor
Author
|
Update: merged latest main into this branch to resolve conflict. No scope change, only conflict resolution around the same 3 files. Re-ran focused tests locally: vitest unhandled-rejections tests pass. |
steipete
force-pushed
the
codex/fix-dns-unhandled-rejection
branch
from
February 23, 2026 18:27
1bfa6f4 to
ef0ee91
Compare
Contributor
Author
|
@arosstale good catch, thank you. We narrowed that regex in main to specific UND_ERR codes, so broad matches are not used now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / What changed
src/infra/unhandled-rejections.ts.cause,original,error,data,errors[]) before deciding fatal/non-fatal.src/infra/unhandled-rejections.test.tssrc/infra/unhandled-rejections.fatal-detection.test.tsWhy
A short DNS failure (
EAI_AGAIN) should not terminate the whole gateway process.Before this change, wrapped request errors could bypass transient detection and trigger process exit, causing restart loops and channel downtime.
Tests
pnpm exec vitest run src/infra/unhandled-rejections.test.ts src/infra/unhandled-rejections.fatal-detection.test.ts --config vitest.unit.config.tsReal-world validation
AI-assisted disclosure
Issue
Fixes #24581
Greptile Summary
Enhanced transient network error detection to prevent gateway exits on wrapped DNS/network failures by implementing breadth-first traversal of error wrapper structures (
cause,original,error,data,errors[]).EAI_AGAINand other network codes in.originalfieldConfidence Score: 5/5
Last reviewed commit: de2d637