This is an automated email from the ASF dual-hosted git repository. stigahuang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/impala.git
commit efd8988acf66b930343f4e61e304a2a930fbca3e Author: Csaba Ringhofer <[email protected]> AuthorDate: Wed Feb 25 13:19:29 2026 +0100 IMPALA-14781: Use real host name in URL in dual stack webui Before this patch :::25000 was used incorrectly instead of hostname:25000. While listening to :: is needed for dual stack, this url is only reachable on localhost. Note that ::: is also incorrect because ipv6 addresses in URLs should be bracketed: [::]: Change-Id: I655cb0240008d60066f81a93a0ece3c0c75d00cb Reviewed-on: http://gerrit.cloudera.org:8080/24032 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- be/src/util/network-util.cc | 2 +- tests/custom_cluster/test_ipv6.py | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/be/src/util/network-util.cc b/be/src/util/network-util.cc index 61b499eab..9ad4dd2f3 100644 --- a/be/src/util/network-util.cc +++ b/be/src/util/network-util.cc @@ -233,7 +233,7 @@ NetworkAddressPB MakeNetworkAddressPB(const std::string& hostname, int port, } bool IsWildcardAddress(const string& ipaddress) { - return ipaddress == "0.0.0.0"; + return ipaddress == "0.0.0.0" || ipaddress == "::"; } string TNetworkAddressToString(const TNetworkAddress& address) { diff --git a/tests/custom_cluster/test_ipv6.py b/tests/custom_cluster/test_ipv6.py index f014758e7..7bb76b1ed 100644 --- a/tests/custom_cluster/test_ipv6.py +++ b/tests/custom_cluster/test_ipv6.py @@ -21,6 +21,7 @@ import json import logging import os import pytest +import re import requests import sys @@ -104,18 +105,26 @@ class TestIPv6Base(CustomClusterTestSuite): def _webui_smoke(self, url, err=None): """Tests to check glibc version and locale is available""" + verify_param = self.ca_cert if self.ca_cert else False try: - if self.ca_cert: - other_info_page = requests.get(url + "/?json", verify=self.ca_cert).text - else: - other_info_page = requests.get(url + "/?json", verify=False).text + json_resp = requests.get(url + "/?json", verify=verify_param).text assert err is None - other_info = json.loads(other_info_page) + other_info = json.loads(json_resp) assert "glibc_version" in other_info except Exception as ex: if not err: raise ex assert err in str(ex) + if err: return + # If successful, also check with x-forwarded-context to verify that + # links are to the host name and not to "::" in the result (IMPALA-14781) + # With x-forwarded-context absolute links are used instead of relative + # ones. See TestWebPage.test_knox_compatibility for a more complex test about this. + headers = {'x-forwarded-context': 'abc'} + html_resp = requests.get(url, headers=headers, verify=verify_param).text + assert re.search(r'href="https?://.+:', html_resp) + assert not re.search(r'href="https?://\[?::\]?:', html_resp) + def _shell_smoke(self, host, vector, expected_errors=[]): proto = vector.get_value('protocol') port = self._get_default_port(proto)
