Skip to content

[fix][proxy] Close channel on connection failure#25770

Merged
nodece merged 1 commit into
apache:masterfrom
nodece:close-channel-on-connection-fail-on-proxy
May 14, 2026
Merged

[fix][proxy] Close channel on connection failure#25770
nodece merged 1 commit into
apache:masterfrom
nodece:close-channel-on-connection-fail-on-proxy

Conversation

@nodece
Copy link
Copy Markdown
Member

@nodece nodece commented May 14, 2026

Motivation

When establishing a direct proxy connection fails, the outbound channel may remain open until it is cleaned up asynchronously. In some cases, this can leave stale connections or unreleased resources behind, especially during rapid reconnects or connection timeouts.

This change ensures the outbound channel is explicitly closed before closing the inbound channel when connection establishment fails, improving resource cleanup consistency and reducing the risk of leaked or half-open channels.

Modifications

  • Explicitly closes the outbound channel (f.channel()) when the connection attempt fails before closing the inbound channel.

@nodece nodece requested review from dao-jun, lhotari and merlimat May 14, 2026 02:23
@nodece nodece force-pushed the close-channel-on-connection-fail-on-proxy branch from c41dffa to 2c32ebe Compare May 14, 2026 02:27
@nodece nodece force-pushed the close-channel-on-connection-fail-on-proxy branch from 2c32ebe to bd3698a Compare May 14, 2026 02:29
@lhotari lhotari added this to the 5.0.0-M1 milestone May 14, 2026
Copy link
Copy Markdown
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

LGTM

@nodece nodece merged commit 35cf8f1 into apache:master May 14, 2026
43 checks passed
@nodece nodece deleted the close-channel-on-connection-fail-on-proxy branch May 14, 2026 07:21
lhotari pushed a commit that referenced this pull request May 18, 2026
lhotari pushed a commit that referenced this pull request May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants