Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SockConect doesn't resolve domain before connecting #1183

Merged
merged 3 commits into from
Dec 17, 2022
Merged

Fix SockConect doesn't resolve domain before connecting #1183

merged 3 commits into from
Dec 17, 2022

Conversation

git-hulk
Copy link
Member

@git-hulk git-hulk commented Dec 16, 2022

This closes #1182

Currently, Kvrocks supports connecting the server with timeout or not, but the behavior is a bit different between them. The timeout version doesn't support resolving the domain before connecting to the server, so it'll be broken if use it to connect the domain.

SockConnect with timeout is the first time to use in #1172, so this bug won't affect the previous releases.

Currently, Kvrocks supports connecting server with timeout
or not, but the behavior is a bit different between them.
The timeout version doesn't support resolving domain before
connecting server, so it'll be broken if connects with timeout.
juancresc
juancresc previously approved these changes Dec 16, 2022
src/common/io_util.cc Outdated Show resolved Hide resolved
@git-hulk git-hulk requested review from PragmaTwice and juancresc and removed request for juancresc December 17, 2022 04:46
@git-hulk git-hulk marked this pull request as ready for review December 17, 2022 04:47
if (fcntl(*fd, F_SETFL, socket_arg) < 0) {
return Status::FromErrno();
if (!s.IsOK()) {
continue;
Copy link
Member

Choose a reason for hiding this comment

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

continue or return error directly, which is better here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks better to continue if it has other addresses to have a try.

@git-hulk
Copy link
Member Author

Thanks all, merging...

@git-hulk git-hulk merged commit 1dcd01c into apache:unstable Dec 17, 2022
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.

SockConnect with timeout doesn't support resolve domain
5 participants