-
Notifications
You must be signed in to change notification settings - Fork 28
fix(NAPPCORE-2747): Broadcast only primary interface events. #1586
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
base: main
Are you sure you want to change the base?
Conversation
tomasz-grz
left a comment
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.
Some minor notes, otherwise +1
|
Nice! Please clean up the commit history before merging. Also if you add a comment in the |
|
Hey @tomasz-grz, what do you mean by "clean up commit history"? Do you suggest squashing it all? And regarding the file in the |
|
@oleksii-skidan Yes squash them, or you can "Squash and Merge" (Just don't tell anybody I said that) 😀 Not sure why check-dod is not happy... |
|
@oleksii-skidan regarding the If you add a simple oneliner like this the ticket/PR will be listed in the changelog. |
…ened on a primary interface.
eaf374c to
f7800f9
Compare
|
Hey @tomasz-grz, sorry for the delay :) I squashed it, updated the PR description, and added a one-liner to the changelog. |
|
Also, our QA tested this change and it works as expected 🎉 |
|
Hey @tomasz-grz and @LukasPukenis, could you please take another look at this PR, approve it, and merge? 🥺 |
Problem
We have noticed that the socket protector on Apple appears to rebind sockets too frequently. For example, when a cellular connection is enabled and the system transitions from Wi-Fi, it will rebind sockets first due to the change in the Cellular interface, then due to the change in the Wi-Fi interface. What I noticed was that when this was happening, the Cellular interface was not the primary one yet.
We have a suspicion that this may be causing hard-to-track no-nets. I made a build for Rolandas Pakėnas with this fix (as he was the one who reported the most frequent occurrences of no-nets), which he daily drove for a week. His feedback was that the no-nets stopped occurring for him.
Solution
I added a bit of code (not included in this MR) that was dumping the changed DynamicStore keys. That's how I know that sometimes we try rebinding sockets due to changes in non-primary interfaces. From the numerous dumps, the keys that we are interested in the most seem to be these:
State:/Network/Interface/<interface>/IPConfigurationBusyState:/Network/Global/IPv4State:/Network/Interface/<interface>/IPv4State:/Network/Interface/<interface-UUID>/IPv4Theoretically, when we get
IPConfigurationBusy, we must check if the corresponding value istrueand rebind only if it is. But at the moment, it seems to be too much of a change for a single MR. And without this pedantic change, the results are quite promising.The change is: I added a filtering step to
dynamic_store_callbackintelio-sockets/src/protector/apple.rs. It checks if the change key is one of the above. And it checks if the interface is primary.☑️ Definition of Done checklist