[Q] When a Network Extension is being upgraded/downgraded (and the .app Network Extension wrapper accepts it), what does macOS promise when it comes to the order of operations?
a) Will the "new" extension be only started when the running one is fully exited?
b) Will the "new" extension be started just after the first attempt to exit the running one has been triggered?
I have not found any official documentation about this (Apple dev website, quick search of WWDC video transcripts) so far.
From what I'm observing, macOS follows case b):
- there is an attempt to kill/terminate the running extension
- a watchdog is installed to check whether the extension is still running after x seconds.
- the system does not wait for the exit to be confirmed before launching the "new" extension.
So if there are issues killing/terminating the previously running extension, there can be 2 extensions running at the same time. Until the watchdog leads to a stronger attempt to exit the old extension.
[Q] What is the promise regarding the calls to startFilterWithCompletionHandler:
and stopFilterWithReason:
?
Will the XPC message that calls startFilterWithCompletionHandler:
be sent only when the previously running extension is fully exited? Or as long as stopFilterWithReason:
from the previously running extension did complete, the XPC message will be sent?