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
Improve local hostname resolution by trying different methods #22512
Improve local hostname resolution by trying different methods #22512
Conversation
538483c
to
0a9b9ed
Compare
0a9b9ed
to
2893ef4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the fix
The job Click to expand the log file-------------------------- -------TEST FAILURE------- -------------------------- [INFO] Results: [INFO] [ERROR] Errors: [ERROR] AuthenticationInformationLeakTest.testAuthenticationExceptionDoesNotLeakInfo:99->getKeyValue:170 ? EOF [INFO] [ERROR] Tests run: 4346, Failures: 0, Errors: 1, Skipped: 8 [INFO] |
run-lab-run |
…22501) - Adds automated cluster state management for persistence on kubernetes - Supports cluster-wide shutdown, rolling restart and partial member recovery from failure on kubernetes [HZ-1190] [HZ-1191] [HZ-1193] - Fixes behaviour of readiness probe with persistence enabled [HZ-1349] - Allows tuning either for speedy crash recovery with FROZEN state or availability of in-memory data structures with NO_MIGRATION state for missing members [HZ-1311] - Fixes backup sync after single member crash recovery [HZ-1349] Design document in EE side: https://github.com/vbekiaris/hazelcast-enterprise/blob/enhancements/5.2/k8s-persistence/docs/design/persistence/04-persistence-kubernetes-improvements.md (cherry picked from commit 1ddc16e) 1:1 clean backport of #21844 to 5.2.0 release branch Also includes backport of #22512 Co-authored-by: Łukasz Dziedziul <lukasz.dziedziul@hazelcast.com>
The job Click to expand the log file-------------------------- -------TEST FAILURE------- -------------------------- [INFO] Results: [INFO] [ERROR] Failures: [ERROR] ClientQueryCacheRecreationTest.listeners_still_works_after_query_cache_recreation:154->HazelcastTestSupport.assertTrueEventually:1338->HazelcastTestSupport.assertTrueEventually:1236->lambda$listeners_still_works_after_query_cache_recreation$0:152 expected:<90> but was:<12> [INFO] [ERROR] Tests run: 50915, Failures: 1, Errors: 0, Skipped: 238 [INFO] |
run-lab-run |
The job Click to expand the log file-------------------------- -------TEST FAILURE------- -------------------------- [INFO] Results: [INFO] [ERROR] Errors: [ERROR] AuthenticationInformationLeakTest.testAuthenticationExceptionDoesNotLeakInfo:99->getKeyValue:170 ? EOF [INFO] [ERROR] Tests run: 4346, Failures: 0, Errors: 1, Skipped: 8 [INFO] |
Process exec = Runtime.getRuntime().exec("hostname"); | ||
exec.waitFor(PROCESS_TIMEOUT_IN_SECONDS, TimeUnit.SECONDS); | ||
InputStream stream = exec.getInputStream(); | ||
return new BufferedReader(new InputStreamReader(stream)).lines().collect(Collectors.joining("\n")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be in try-with-resources to avoid leaks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not necessary since process streams are closed when the process is finished.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx
…22502) - Adds automated cluster state management for persistence on kubernetes - Supports cluster-wide shutdown, rolling restart and partial member recovery from failure on kubernetes [HZ-1190] [HZ-1191] [HZ-1193] - Fixes behaviour of readiness probe with persistence enabled [HZ-1349] - Allows tuning either for speedy crash recovery with FROZEN state or availability of in-memory data structures with NO_MIGRATION state for missing members [HZ-1311] - Fixes backup sync after single member crash recovery [HZ-1349] Design document in EE side: https://github.com/vbekiaris/hazelcast-enterprise/blob/enhancements/5.2/k8s-persistence/docs/design/persistence/04-persistence-kubernetes-improvements.md (cherry picked from commit 1ddc16e) 1:1 clean backport from #21844 Also includes backport of #22512 Co-authored-by: Łukasz Dziedziul <lukasz.dziedziul@hazelcast.com>
Getting hostname from HOSTNAME env variables doesn't work on vanilla non-containerised Ubuntu systems.
Here's the failures on non-dockerized env: https://jenkins.hazelcast.com/job/Hazelcast-master-OracleJDK8-Esxi7/4/#showFailuresLink
Example on clean AWS ubuntu:
ubuntu version
java version
Getting hostname with different methods
This PR tries to improve hostname resolution by trying different methods:
hostname
system commandInetAddress.getLocalHost().getHostName()
(broken DNS setup can break it)Reference: