Frequent sleep and wakeups for PacketTunnelProvider

We have noticed that sometimes there are frequent sleep and wakeup calls in our PacketTunnelProvider logs despite no user interaction. For example:

  2023-02-28 10:37:04.446111 UTC wake
  2023-02-28 10:37:07.446953 UTC sleepWithCompletionHandler
  2023-02-28 10:37:10.245550 UTC wake
  2023-02-28 10:37:13.245609 UTC sleepWithCompletionHandler
  2023-02-28 10:37:14.601693 UTC wake
  2023-02-28 10:37:17.601220 UTC sleepWithCompletionHandler
  2023-02-28 10:37:20.476486 UTC wake
  2023-02-28 10:37:23.478591 UTC sleepWithCompletionHandler
  2023-02-28 10:37:26.884939 UTC wake
  2023-02-28 10:37:29.884604 UTC sleepWithCompletionHandler
  2023-02-28 10:37:32.232937 UTC wake
  2023-02-28 10:37:35.234157 UTC sleepWithCompletionHandler
  2023-02-28 10:37:35.861171 UTC wake
  2023-02-28 10:37:38.862450 UTC sleepWithCompletionHandler
  2023-02-28 10:37:39.672081 UTC wake
  2023-02-28 10:37:42.673964 UTC sleepWithCompletionHandler
  2023-02-28 10:37:47.362123 UTC wake
  2023-02-28 10:37:50.363501 UTC sleepWithCompletionHandler
  2023-02-28 10:37:53.759341 UTC wake
  2023-02-28 10:37:56.762477 UTC sleepWithCompletionHandler
  2023-02-28 10:37:58.879447 UTC wake
  2023-02-28 10:38:01.881076 UTC sleepWithCompletionHandler
  2023-02-28 10:38:05.284252 UTC wake
  2023-02-28 10:38:08.284785 UTC sleepWithCompletionHandler
  2023-02-28 10:38:10.398992 UTC wake
  2023-02-28 10:38:13.399746 UTC sleepWithCompletionHandler
  2023-02-28 10:38:16.801673 UTC wake
  2023-02-28 10:38:19.801687 UTC sleepWithCompletionHandler
  2023-02-28 10:38:21.183971 UTC wake
  2023-02-28 10:38:24.185463 UTC sleepWithCompletionHandler
  2023-02-28 10:38:27.645370 UTC wake
  2023-02-28 10:38:30.643598 UTC sleepWithCompletionHandler
  2023-02-28 10:38:33.439431 UTC wake
  2023-02-28 10:38:36.440460 UTC sleepWithCompletionHandler
  2023-02-28 10:38:39.838367 UTC wake
  2023-02-28 10:38:42.839743 UTC sleepWithCompletionHandler
  2023-02-28 10:38:44.961735 UTC wake

This can be problematic since we disconnect the tunnel connection on sleep and reconnect on wake. What could be causing such frequent sleeping and waking? Is there a workaround that could be used to avoid having to reconnect so often? Maybe a way to tell if the device screen is even on or unlocked when it is waking up?

> What could be causing such frequent sleeping and waking?

It’s hard to say for sure. Although I can say that I’m talking to another developer with a similar issue (FB12046457). My advice is that you file your own bug about this. If you can reproduce the problem at all, trigger a sysdiagnose as soon as you see it and attach that to your bug.

For more information about sysdiagnose logs, see our Bug Reporting > Profiles and Logs page.

Please post post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Frequent sleep and wakeups for PacketTunnelProvider
 
 
Q