Commit Graph
7 Commits
Author SHA1 Message Date
Juliet Levesque 240159e872 [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
2023-06-12 10:16:36 -07:00
Juliet Levesque 8a78212bb8 [Nearby Connections] Check for shutdown before accessing ClientProxy.
During the destruction of NearbyConnections, Core (which owns ClientProxy) is destructed before ServiceController (which owns EndpointManager), which means any pending tasks on the EndpointManager executor that use ClientProxy will be using
garbage memory. To fix this issue, EndpointManager::DiscardEndpoint will check
for an `is_shutdown` boolean set during ~EndpointManager before accessing
ClientProxy. The assumption is that any accessing of ClientProxy after the
destruction will be invalid.

PiperOrigin-RevId: 532581122
2023-05-16 14:54:20 -07:00
Nick Bourdakos ebab912fb6 Fix heap-use-after-free issue in fake timer
PiperOrigin-RevId: 530644090
2023-05-09 10:15:09 -07:00
Guogang Li 15d81201f8 Fixed data race in FakeTaskRunner
PiperOrigin-RevId: 528627577
2023-05-01 18:06:35 -07:00
Guogang Li 46e4b3eca7 Fixed a data race bug in test codes
PiperOrigin-RevId: 528074883
2023-04-28 22:25:09 -07:00
Qin Wang 698ca77f2a Mutex guard FakeClock
PiperOrigin-RevId: 527382176
2023-04-26 14:52:46 -07:00
Qin Wang 86ca85b85a Migrate fake functions to third_party/nearby to help unit test
PiperOrigin-RevId: 517433481
2023-03-17 09:34:58 -07:00