forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mobile: Stop the DNS cache when the network is unavailable (envoyprox…
…y#35922) This PR fixes an issue on Android when the network was unavailable, Envoy Mobile would always refresh the DNS cache causing spurious DNS errors. This PR fixes the issue by cancelling the pending DNS queries and stopping the DNS refresh and timeout timers when the network is unavailable. As a result, this requires adding a new `DnsCache::stop` function. The `InternalEngine` API has also been updated by introducing `onDefaultNetworkAvailable`, `onDefaultNetworkChanged` and `onDefaultNetworkUnavailable` callbacks instead of using `setPreferredNetwork`, a method that has been incorrectly used for on network changed callback. By having these new callbacks, we now have a fine-grained control to refresh and stop the DNS caches. The `AndroidNetworkMonitor` has been reimplemented to use [ConnectivityManager.Network](https://developer.android.com/reference/android/net/ConnectivityManager.NetworkCallback) instead of the deprecated API and more tests has also been added. Risk Level: medium Testing: unit and integration tests Docs Changes: n/a Release Notes: n/a Platform Specific Features: dns, mobile --------- Signed-off-by: Fredy Wijaya <[email protected]>
- Loading branch information
Showing
20 changed files
with
432 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.