cpp_client_telemetry
cpp_client_telemetry copied to clipboard
Flush() and iOS watchdog SIGKILL
The iOS watchdog in some iOS versions will SIGKILL an application if it holds a file lock or sqlite lock when the operating system suspends the app. Suspend occurs in background applications, usually within 30 seconds of an application entering the background state.
To better support the iOS model and avoid application crashes, it would be delightful if we could get a few extra features on Flush:
- asynchronous notification (e.g., promise) when the flush completes.
- abort a flush in progress. The iOS API for notifying the system that you have a task you need to complete (like flush) has some expectations. It hands out a "task id" that the application should use to notify the OS that a task has completed. It also hands out a callback that should abort and complete a task in progress unconditionally, either because time has run out (by default I believe you get 30 seconds) or because the operating system just wants to suspend early for its own reasons.
- a PauseFlush() to prevent the SDK from starting a new flush job when we are about to be suspended.