Skip to content

network: restore the network namespace when listener socket setup throws - #48392

Merged
agrawroh merged 3 commits into
envoyproxy:mainfrom
agrawroh:netns-restore-on-throw
Oct 18, 2026
Merged

agrawroh merged 3 commits into
envoyproxy:mainfrom
agrawroh:netns-restore-on-throw

Conversation

@agrawroh

Copy link
Copy Markdown
Member

Description

This PR restores the original network namespace of the calling thread when the function run inside another namespace throws. Before this change, when a listener in a network namespace failed to bind, the main thread stayed in that namespace. It then kept creating its sockets there, and worker threads started afterwards inherited that namespace.


Commit Message: network: restore the network namespace when listener socket setup throws
Risk Level: Low
Testing: Added Tests
Docs Changes: Added
Release Notes: Added

Comment thread source/common/network/utility.h Resolved
wbpcode
wbpcode previously approved these changes Oct 17, 2026

@wbpcode wbpcode left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one nit.

@agrawroh
agrawroh merged commit 45f1e10 into envoyproxy:main Oct 18, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants