[Nearby Connections] Stop 3 AttemptsToConnect over WebRTC for CancellationFlag

CancellationFlags will be used to prevent crashes during the shutdown of Nearby Connections from pending tasks taking too long during the shutdown period. WebRTC using 3 x 10s retries to connect, which means we are potentially waiting for 30 seconds of retries to execute during shutdown (which is longer than the 10s duration alloted for Core shutdown).

By using CancellationFlags, we can prevent the retries occuring during the Shutdown by short-circuiting an in flight AttemptToConnect, and checking for Cancellation before retries.

PiperOrigin-RevId: 539690403
This commit is contained in:
Juliet Levesque
2023-06-12 10:16:36 -07:00
committed by Copybara-Service
parent 39e54e8a0c
commit 240159e872
10 changed files with 328 additions and 25 deletions
+1
View File
@@ -534,6 +534,7 @@ let package = Package(
"internal/network/http_status_code_test.cc",
"internal/test/google3_only/fake_authentication_manager_test.cc",
"internal/test/fake_clock_test.cc",
"internal/test/fake_webrtc.cc",
"internal/test/fake_timer_test.cc",
"internal/test/fake_device_info_test.cc",
"internal/test/fake_task_runner_test.cc",