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: Use default localhost finder for MacOs - fix #2098 #2134
fix: Use default localhost finder for MacOs - fix #2098 #2134
Conversation
d809e2d
to
8a1c943
Compare
8a1c943
to
fada7b4
Compare
…zi/liquibase into grzi-fix/slow_get_localhost_on_mac
…generic check for whether a loopback or local address got returned before falling back to iterating over interfaces Also cached the found interface to avoid future lookups
I merged the current master branch into the fork. I also changed the implementation a bit in the fork and added more tests. Since it seems that the Testing on windows, the code didn't fall back into the loop through. Thanks for the details on how mac behaves, @grzi |
This PR removes OS-specific code to get the hostaddress and uses Validate update-sql INSERT for DATABASECHANGELOGLOCK.LOCKEDBY includes hostname and hostaddress.
Verify update using an empty changelog on a Mac takes less than 30 seconds. PASS
Limitations in Test Methodology
Issues Logged During Test (loosely related to this PR) Test Environment |
I don't see anything new in master that would make this be so much faster in master vs. here besides changes to this logic. If you're seeing this code faster on you rmac vs the old version, @grzi , we'll have to do more research into why and what the best logic to use is. I don't want to just accept this PR and end up making it slower for a majority of people. |
…zi/liquibase into grzi-fix/slow_get_localhost_on_mac
…external address does not have a useful host name attached to it.
I guess I see that there is some additional caching in NetUtil to avoid so many hostname/IP lookups. That must be the main change. @MalloD12 fixed up the hostname handling so it will check localhost for a hostname when the external interface's hostname is not set. That is the code used by the databasechangeloglock description that you were seeing off, @XDelphiGrl. It's ready to test again |
Tested this PR against MacOS and it looks like its showing the hostname instead of localhost now. |
This will fix #2098
The NetUtil retrieves a 'wrong' localhost addr on local, that is impossible to map under 30 seconds, using the standard way makes it instant.
Dev Handoff Notes (Internal Use)
Links
Testing
liquibase update
liquibase list-locks
to ensure that the hostname is not localhostliquibase update
with an empty changelog so that there is little to do. On mac, it should be about as fast as windows/linuxDev Verification
Ran updated NetUtilTest on linux and windows. Don't have a mac to run it on
Test Requirements (Liquibase Internal QA)
Performance testing is out of scope for this issue. QA will validate that the correct hostname is used and that update is successful, but not how long it takes an update to run.
Manual Tests
TEST 1: Verify the DATABASECHANGELOGLOCK.LOCKEDBY has the test machine's name and not localhost.
Start a Liquibase update to add a column to table accounts:
liquibase update --changelog-file addColumn-changelog.sql
In another command prompt, run:
liquibase list-locks
The list-locks command outputs the lock information with the machine name, for example:
- LENOVO (172.21.224.1) at Dec 2, 2021 3:54:40 PM
, where LENOVO is the machine name.TEST 2: Verify an update operation is successful.
Execute Liquibase update:
liquibase update --changelog-file addColumn-changelog.sql
Automated Tests
┆Issue is synchronized with this Jira Bug by Unito