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

NAS-130867 / 25.04 / Simplify {TCPIP/UnixSock}Origin to ConnectionOrigin #14372

Merged
merged 19 commits into from
Aug 30, 2024

Conversation

yocalebo
Copy link
Contributor

I broke app.query recently because we're passing @pass_app objects around. After investigating this for 2 days, I realized we can simplify all of this and get rid of public methods like websocket_local_ip and websocket_interface and get the same information directly from the app.origin object.

This removes all the Origin classes (and subclass) and creates a singular ConnectionOrigin object. I moved over the logic from the other classes to this one but added a few convenient properties (is_ha_connection) so it's easier to use. This removes the necessity for importing these origin classes everywhere and doing isinstance calls. I also get rid of the read_proc_net and get_remote_addr functions. The former is actually deprecated and the latter is unnecessarily expensive.

CI runs for both HA and Single node passed with no obvious regressions: (here and here)

@yocalebo yocalebo requested a review from a team August 29, 2024 19:57
@bugclerk
Copy link
Contributor

@bugclerk bugclerk changed the title Simplify {TCPIP/UnixSock}Origin to ConnectionOrigin NAS-130867 / 25.04 / Simplify {TCPIP/UnixSock}Origin to ConnectionOrigin Aug 29, 2024
@truenas truenas deleted a comment from bugclerk Aug 29, 2024
@yocalebo yocalebo requested a review from themylogin August 30, 2024 11:10
@yocalebo yocalebo requested a review from themylogin August 30, 2024 12:33
Copy link
Contributor

@themylogin themylogin left a comment

Choose a reason for hiding this comment

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

Thank you!

@yocalebo yocalebo merged commit 532e4f2 into master Aug 30, 2024
3 checks passed
@yocalebo yocalebo deleted the improv branch August 30, 2024 16:07
@bugclerk
Copy link
Contributor

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants