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

HAWQ-1051. Failing in reverse DNS lookup causes resource manager core… #928

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/backend/resourcemanager/requesthandler.c
Expand Up @@ -627,7 +627,11 @@ bool handleRMSEGRequestIMAlive(void **arg)
fts_client_ip_len = strlen(fts_client_ip);
inet_aton(fts_client_ip, &fts_client_addr);
fts_client_host = gethostbyaddr(&fts_client_addr, 4, AF_INET);
Assert(fts_client_host != NULL);
if (fts_client_host == NULL)
{
elog(WARNING, "Failed to reverse DNS lookup for ip %s.", fts_client_ip);
return true;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

If it is easy to modify we could use the replacement of gethostbyaddr().
By the way, why need to quit after "reverse dns lookup" failure. Should not
an IP address work also?

DESCRIPTION
The gethostbyname_() and gethostbyaddr_() functions are obsolete. Applications
should use getaddrinfo(3) and getnameinfo(3) instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not quit after "reverse dns lookup" failure. This function handles the IMAlive message from segment resource manager process. "return true" just ignore this message and do not continue the followup work after a lookup failure. IP address is not enough since followup work needs the hostname.

For replace gethostbyaddr(), @jiny2 could you give some comments ?

/* Get the received machine id instance start address. */
SegInfo fts_client_seginfo = (SegInfo)(SMBUFF_CONTENT(&(conntrack->MessageBuff)) +
Expand Down