Skip to content

fix(services/memcached): TCP address resolution#7701

Open
flip1995 wants to merge 1 commit into
apache:mainfrom
flip1995:tcp-address-resolve-fix
Open

fix(services/memcached): TCP address resolution#7701
flip1995 wants to merge 1 commit into
apache:mainfrom
flip1995:tcp-address-resolve-fix

Conversation

@flip1995
Copy link
Copy Markdown

@flip1995 flip1995 commented Jun 5, 2026

Which issue does this PR close?

PR #7112 added support for Unix sockets to the memcached backend. As a side effect, it switched the TCP address parsing from being done inside of TcpStream::connect to SocketAddr::parse. The major difference is that SocketAddr::parse cannot resolve addresses like localhost:1234, as it errors out if it sees non-octal numbers in the address.

I didn't create an issue, but can do so if required.

cc @zenyanle @tisonkun

Rationale for this change

#7112 claimed:

Existing TCP configurations (e.g., 127.0.0.1:11211) remain unaffected.

But it broke TCP configurations like tcp://localhost:11211.

So, this seemed like an unintended breaking change to me. I also can't see the benefit of doing that, as TcpStream::connect already calls to_socket_addrs internally.

What changes are included in this PR?

Remove the additional and more restrictive SocketAddr parsing.

Are there any user-facing changes?

This restores the behavior from before the 0.56.0 release. This is required to bump the opendal dependency in sccache:

which fixes a transitive GCS issue that was fixed in opendal in version 0.56.0:

AI Usage Statement

I used Gemini to find the PR #7112 that introduced this change, but came up and implemented the fix myself.

PR apache#7112 added support for Unix sockets to the memcached backend. As a
side effect, it switched the TCP address parsing from being done inside
of `TcpStream::connect` to `SocketAddr::parse`. The major difference is
that `SocketAddr::parse` cannot resolve addresses like `localhost:1234`,
as it errors out if it sees non-octal numbers in the address.

This seemed like an unintended breaking change to me. I also can't see
the benefit of doing that, as `TcpStream::connect` already calls
`to_socket_addrs` internally.
@flip1995 flip1995 requested a review from Xuanwo as a code owner June 5, 2026 10:58
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. releases-note/fix The PR fixes a bug or has a title that begins with "fix" labels Jun 5, 2026
@flip1995 flip1995 changed the title [memcached] Fix TCP address resolution fix(memcached): TCP address resolution Jun 5, 2026
@flip1995 flip1995 changed the title fix(memcached): TCP address resolution fix(services/memcached): TCP address resolution Jun 5, 2026
@flip1995
Copy link
Copy Markdown
Author

flip1995 commented Jun 5, 2026

Both of those CI failures seem unrelated to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/fix The PR fixes a bug or has a title that begins with "fix" size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant