However, when the task runs organically in the background, it's killed after about a minute with
Code Block Terminated due to signal 9
I checked the reason from device logs and it's due to CPU utilization
Code Block Event: cpu usage Action taken: Process killed CPU: 48 seconds cpu time over 50 seconds (97% cpu average), exceeding limit of 80% cpu over 60 seconds
This doesn't make any sense, as the whole point of BGProcessingTask is disabling the CPU limits for a few minutes to run big tasks in the background.
See this short clip: https://developer.apple.com/videos/play/wwdc2019/707/?time=1069
CPU Monitor is a feature in our systems that automatically terminates apps that use too many CPU cycles in the background in order to protect user's battery life.For the first time ever, we're giving you the ability to turn that off for the duration of your processing task so you can take full advantage of the hardware while the device is plugged in.And finally, we'll make sure that you're eligible to run these tasks as long as you request them when your app is foreground or if your app has been recently used in the foreground.
Any idea why this is happening?
Full callstack:
https://paste bin.com/aaM264Pe